coverage-report

Code coverage report for All files

npmtest-rdb (v0.0.1)

Code coverage report for All files

Statements: 31.88% (2047 / 6420)      Branches: 20.36% (134 / 658)      Functions: 3.89% (35 / 899)      Lines: 31.92% (2047 / 6413)      Ignored: 26 statements, 1 function, 30 branches     

File Statements Branches Functions Lines
node-npmtest-rdb/ 100% (153 / 153) 100% (126 / 126) 100% (28 / 28) 100% (153 / 153)
node-npmtest-rdb/node_modules/rdb/ 30.04% (67 / 223) 0% (0 / 12) 1.96% (1 / 51) 30.04% (67 / 223)
node-npmtest-rdb/node_modules/rdb/createDomain/ 30.77% (4 / 13) 0% (0 / 4) 0% (0 / 5) 36.36% (4 / 11)
node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/ 16.98% (9 / 53) 100% (0 / 0) 0% (0 / 3) 16.98% (9 / 53)
node-npmtest-rdb/node_modules/rdb/createDomainSpec/ 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
node-npmtest-rdb/node_modules/rdb/createDomainSpec/req/ 20% (6 / 30) 100% (0 / 0) 0% (0 / 2) 20% (6 / 30)
node-npmtest-rdb/node_modules/rdb/emitEventSpec/ 50% (2 / 4) 100% (0 / 0) 0% (0 / 1) 50% (2 / 4)
node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/ 50% (25 / 50) 100% (0 / 0) 0% (0 / 6) 50% (25 / 50)
node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/add/ 63.64% (7 / 11) 100% (0 / 0) 0% (0 / 2) 63.64% (7 / 11)
node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/ 15.79% (3 / 19) 100% (0 / 0) 0% (0 / 1) 15.79% (3 / 19)
node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req/ 22.58% (7 / 31) 100% (0 / 0) 0% (0 / 2) 22.58% (7 / 31)
node-npmtest-rdb/node_modules/rdb/indexSpec/ 13.04% (3 / 23) 100% (0 / 0) 0% (0 / 1) 13.04% (3 / 23)
node-npmtest-rdb/node_modules/rdb/indexSpec/req/mySql/ 50% (5 / 10) 100% (0 / 0) 0% (0 / 1) 50% (5 / 10)
node-npmtest-rdb/node_modules/rdb/indexSpec/req/other/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/indexSpec/req/pg/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/indexSpec/req/sqllite/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/lock/ 20% (5 / 25) 0% (0 / 12) 0% (0 / 4) 20% (5 / 25)
node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/ 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/ 37.04% (10 / 27) 100% (0 / 0) 0% (0 / 3) 37.04% (10 / 27)
node-npmtest-rdb/node_modules/rdb/lockSpec/ 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
node-npmtest-rdb/node_modules/rdb/lockSpec/req/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/mySql/ 42.57% (43 / 101) 0% (0 / 4) 0% (0 / 17) 42.57% (43 / 101)
node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/ 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/req/ 25% (6 / 24) 100% (0 / 0) 0% (0 / 3) 25% (6 / 24)
node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/new/ 23.53% (8 / 34) 0% (0 / 2) 0% (0 / 3) 23.53% (8 / 34)
node-npmtest-rdb/node_modules/rdb/mySql/newPoolSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/mySql/newTransactionSpec/new/ 30.77% (4 / 13) 100% (0 / 0) 0% (0 / 3) 30.77% (4 / 13)
node-npmtest-rdb/node_modules/rdb/mySql/pool/ 40% (6 / 15) 0% (0 / 2) 0% (0 / 3) 40% (6 / 15)
node-npmtest-rdb/node_modules/rdb/mySql/pool/endSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/mySql/selectForUpdateSqlSpec/ 27.27% (3 / 11) 100% (0 / 0) 0% (0 / 1) 27.27% (3 / 11)
node-npmtest-rdb/node_modules/rdb/mySql/wrapQuerySpec/ 16.67% (2 / 12) 100% (0 / 0) 0% (0 / 1) 16.67% (2 / 12)
node-npmtest-rdb/node_modules/rdb/mySql/wrapQuerySpec/wrap/ 17.65% (3 / 17) 100% (0 / 0) 0% (0 / 1) 17.65% (3 / 17)
node-npmtest-rdb/node_modules/rdb/mySql/wrapQueryStreamSpec/ 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
node-npmtest-rdb/node_modules/rdb/mySql/wrapQueryStreamSpec/wrap/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/newCollectionSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/ 43.75% (7 / 16) 100% (0 / 0) 0% (0 / 2) 43.75% (7 / 16)
node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/addRange/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/newIdSpec/ 30% (3 / 10) 100% (0 / 0) 0% (0 / 1) 30% (3 / 10)
node-npmtest-rdb/node_modules/rdb/newImmutableSpec/new/ 30% (3 / 10) 100% (0 / 0) 0% (0 / 1) 30% (3 / 10)
node-npmtest-rdb/node_modules/rdb/newImmutableSpec/new/execute/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/newObjectSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/pg/ 40.63% (52 / 128) 0% (0 / 8) 0% (0 / 20) 40.63% (52 / 128)
node-npmtest-rdb/node_modules/rdb/pg/encodeBooleanSpec/ 27.27% (3 / 11) 100% (0 / 0) 0% (0 / 1) 27.27% (3 / 11)
node-npmtest-rdb/node_modules/rdb/pg/encodeDateSpec/ 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
node-npmtest-rdb/node_modules/rdb/pg/encodeDateSpec/req/ 33.33% (2 / 6) 100% (0 / 0) 100% (0 / 0) 33.33% (2 / 6)
node-npmtest-rdb/node_modules/rdb/pg/newDatabaseSpec/ 13.33% (2 / 15) 100% (0 / 0) 0% (0 / 1) 13.33% (2 / 15)
node-npmtest-rdb/node_modules/rdb/pg/newDatabaseSpec/req/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/pg/newPoolSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/pg/newTransactionSpec/new/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/pg/pool/ 22% (11 / 50) 6.9% (2 / 29) 0% (0 / 12) 22.92% (11 / 48)
node-npmtest-rdb/node_modules/rdb/pg/pool/endSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/ 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/hasParams/ 33.33% (3 / 9) 100% (0 / 0) 0% (0 / 1) 33.33% (3 / 9)
node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/noParams/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/pg/selectForUpdateSqlSpec/ 27.27% (3 / 11) 100% (0 / 0) 0% (0 / 1) 27.27% (3 / 11)
node-npmtest-rdb/node_modules/rdb/pg/wrapQuerySpec/ 15.38% (2 / 13) 100% (0 / 0) 0% (0 / 1) 15.38% (2 / 13)
node-npmtest-rdb/node_modules/rdb/pg/wrapQuerySpec/wrap/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/pg/wrapQueryStreamSpec/ 14.29% (2 / 14) 100% (0 / 0) 0% (0 / 1) 14.29% (2 / 14)
node-npmtest-rdb/node_modules/rdb/pg/wrapQueryStreamSpec/wrap/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/poolsSpec/ 20% (3 / 15) 100% (0 / 0) 0% (0 / 1) 20% (3 / 15)
node-npmtest-rdb/node_modules/rdb/poolsSpec/req/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/query/ 30.77% (8 / 26) 0% (0 / 10) 0% (0 / 5) 33.33% (8 / 24)
node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/ 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/array/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/nonArray/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/undefined/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/ 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/object/ 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/string/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/query/wrapQuerySpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/querySpec/ 19.05% (4 / 21) 100% (0 / 0) 0% (0 / 2) 19.05% (4 / 21)
node-npmtest-rdb/node_modules/rdb/sqlite/ 38.98% (46 / 118) 0% (0 / 8) 0% (0 / 20) 38.98% (46 / 118)
node-npmtest-rdb/node_modules/rdb/sqlite/encodeBooleanSpec/ 27.27% (3 / 11) 100% (0 / 0) 0% (0 / 1) 27.27% (3 / 11)
node-npmtest-rdb/node_modules/rdb/sqlite/pool/ 26.19% (11 / 42) 8% (2 / 25) 0% (0 / 10) 26.83% (11 / 41)
node-npmtest-rdb/node_modules/rdb/sqlite/pool/endSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/ 32% (329 / 1028) 0.82% (1 / 122) 1.03% (2 / 194) 32% (329 / 1028)
node-npmtest-rdb/node_modules/rdb/table/beginSpec/ 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
node-npmtest-rdb/node_modules/rdb/table/beginSpec/req/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/cascadeDeleteSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/cloneStrategySpec/ 27.27% (3 / 11) 100% (0 / 0) 0% (0 / 1) 27.27% (3 / 11)
node-npmtest-rdb/node_modules/rdb/table/column/ 33.97% (107 / 315) 0% (0 / 28) 0% (0 / 48) 33.97% (107 / 315)
node-npmtest-rdb/node_modules/rdb/table/column/binary/ 41.18% (7 / 17) 0% (0 / 6) 0% (0 / 3) 41.18% (7 / 17)
node-npmtest-rdb/node_modules/rdb/table/column/binarySpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/column/boolean/ 40% (12 / 30) 0% (0 / 12) 0% (0 / 5) 40% (12 / 30)
node-npmtest-rdb/node_modules/rdb/table/column/booleanSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/column/date/ 42.19% (27 / 64) 0% (0 / 20) 0% (0 / 12) 42.19% (27 / 64)
node-npmtest-rdb/node_modules/rdb/table/column/dateSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/column/encodeFilterArgSpec/ 16.67% (2 / 12) 100% (0 / 0) 0% (0 / 1) 16.67% (2 / 12)
node-npmtest-rdb/node_modules/rdb/table/column/equalSpec/ 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
node-npmtest-rdb/node_modules/rdb/table/column/greaterThanOrEqualSpec/ 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
node-npmtest-rdb/node_modules/rdb/table/column/greaterThanSpec/ 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
node-npmtest-rdb/node_modules/rdb/table/column/guid/ 31.58% (6 / 19) 0% (0 / 8) 0% (0 / 3) 31.58% (6 / 19)
node-npmtest-rdb/node_modules/rdb/table/column/guidSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/column/inSpec/ 14.29% (2 / 14) 100% (0 / 0) 0% (0 / 1) 14.29% (2 / 14)
node-npmtest-rdb/node_modules/rdb/table/column/json/ 37.5% (6 / 16) 0% (0 / 6) 0% (0 / 3) 37.5% (6 / 16)
node-npmtest-rdb/node_modules/rdb/table/column/jsonSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/column/lessThanOrEqualSpec/ 16.67% (2 / 12) 100% (0 / 0) 0% (0 / 1) 16.67% (2 / 12)
node-npmtest-rdb/node_modules/rdb/table/column/lessThanSpec/ 16.67% (2 / 12) 100% (0 / 0) 0% (0 / 1) 16.67% (2 / 12)
node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextAndFilterSpec/ 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextOrFilterSpec/ 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
node-npmtest-rdb/node_modules/rdb/table/column/negotiateRawSqlFilterSpec/ 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
node-npmtest-rdb/node_modules/rdb/table/column/newBooleanSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/column/newColumnSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/column/notEqualSpec/ 14.29% (2 / 14) 100% (0 / 0) 0% (0 / 1) 14.29% (2 / 14)
node-npmtest-rdb/node_modules/rdb/table/column/numeric/ 32.26% (10 / 31) 0% (0 / 12) 0% (0 / 6) 32.26% (10 / 31)
node-npmtest-rdb/node_modules/rdb/table/column/numericSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/column/string/ 50.98% (52 / 102) 0% (0 / 20) 0% (0 / 9) 50.98% (52 / 102)
node-npmtest-rdb/node_modules/rdb/table/column/stringSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/ 31.15% (19 / 61) 100% (0 / 0) 0% (0 / 4) 31.15% (19 / 61)
node-npmtest-rdb/node_modules/rdb/table/commands/ 40% (76 / 190) 0% (0 / 20) 0% (0 / 31) 40% (76 / 190)
node-npmtest-rdb/node_modules/rdb/table/commands/beginCommandSpec/ 23.08% (3 / 13) 100% (0 / 0) 0% (0 / 1) 23.08% (3 / 13)
node-npmtest-rdb/node_modules/rdb/table/commands/commitCommandSpec/ 23.08% (3 / 13) 100% (0 / 0) 0% (0 / 1) 23.08% (3 / 13)
node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/ 13.39% (15 / 112) 100% (0 / 0) 0% (0 / 5) 13.39% (15 / 112)
node-npmtest-rdb/node_modules/rdb/table/commands/delete/ 47.37% (9 / 19) 0% (0 / 4) 0% (0 / 2) 47.37% (9 / 19)
node-npmtest-rdb/node_modules/rdb/table/commands/delete/singleCommand/ 30.56% (22 / 72) 0% (0 / 6) 0% (0 / 9) 30.56% (22 / 72)
node-npmtest-rdb/node_modules/rdb/table/commands/getChangeSetSpec/ 27.27% (3 / 11) 100% (0 / 0) 0% (0 / 1) 27.27% (3 / 11)
node-npmtest-rdb/node_modules/rdb/table/commands/insert/ 16.67% (4 / 24) 0% (0 / 2) 0% (0 / 3) 16.67% (4 / 24)
node-npmtest-rdb/node_modules/rdb/table/commands/lastCommandMatchesSpec/ 28.57% (2 / 7) 100% (0 / 0) 0% (0 / 1) 28.57% (2 / 7)
node-npmtest-rdb/node_modules/rdb/table/commands/negotiateEndEditSpec/ 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
node-npmtest-rdb/node_modules/rdb/table/commands/newDeleteCommandSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommandCoreSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommandSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/commands/newRowSpec/ 6.45% (2 / 31) 100% (0 / 0) 0% (0 / 1) 6.45% (2 / 31)
node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommandCoreSpec/ 2.35% (2 / 85) 100% (0 / 0) 0% (0 / 1) 2.35% (2 / 85)
node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommandSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/commands/pushCommandSpec/ 18.75% (3 / 16) 100% (0 / 0) 0% (0 / 1) 18.75% (3 / 16)
node-npmtest-rdb/node_modules/rdb/table/commands/rollbackCommandSpec/ 23.08% (3 / 13) 100% (0 / 0) 0% (0 / 1) 23.08% (3 / 13)
node-npmtest-rdb/node_modules/rdb/table/commitSpec/ 16.67% (2 / 12) 100% (0 / 0) 0% (0 / 1) 16.67% (2 / 12)
node-npmtest-rdb/node_modules/rdb/table/commitSpec/req/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/ 13.04% (3 / 23) 100% (0 / 0) 0% (0 / 1) 13.04% (3 / 23)
node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/create/ 13.04% (3 / 23) 100% (0 / 0) 0% (0 / 1) 13.04% (3 / 23)
node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/ 13.04% (3 / 23) 100% (0 / 0) 0% (0 / 1) 13.04% (3 / 23)
node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/create/ 13.64% (3 / 22) 100% (0 / 0) 0% (0 / 1) 13.64% (3 / 22)
node-npmtest-rdb/node_modules/rdb/table/deleteSessionContextSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/deleteSpec/ 13.33% (2 / 15) 100% (0 / 0) 0% (0 / 1) 13.33% (2 / 15)
node-npmtest-rdb/node_modules/rdb/table/deleteSpec/req/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/domainCache/ 45.45% (5 / 11) 0% (0 / 2) 0% (0 / 1) 45.45% (5 / 11)
node-npmtest-rdb/node_modules/rdb/table/domainCache/getCacheSpec/ 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/ 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/req/ 30% (6 / 20) 100% (0 / 0) 0% (0 / 2) 30% (6 / 20)
node-npmtest-rdb/node_modules/rdb/table/executeQueries/ 36.96% (17 / 46) 0% (0 / 12) 0% (0 / 7) 36.96% (17 / 46)
node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeChangesSpec/ 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQueriesCoreSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQuerySpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/executeQueries/resolveExecuteQuerySpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/ 35.71% (5 / 14) 100% (0 / 0) 0% (0 / 1) 35.71% (5 / 14)
node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/hasParams/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/multipleStatementsNotAllowed/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/noChanges/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/noParams/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/ 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/hasStrategy/ 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 1) 42.86% (3 / 7)
node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/noStrategy/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/getByIdSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/getManySpec/new/ 33.33% (6 / 18) 100% (0 / 0) 0% (0 / 6) 33.33% (6 / 18)
node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/ 11.76% (2 / 17) 100% (0 / 0) 0% (0 / 1) 11.76% (2 / 17)
node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/hasContext/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/noContext/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/getSessionContextSpec/ 18.75% (3 / 16) 100% (0 / 0) 0% (0 / 1) 18.75% (3 / 16)
node-npmtest-rdb/node_modules/rdb/table/getSessionSingletonSpec/ 18.75% (3 / 16) 100% (0 / 0) 0% (0 / 1) 18.75% (3 / 16)
node-npmtest-rdb/node_modules/rdb/table/hasManySpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/hasManySpec/hasMany/ 37.5% (3 / 8) 100% (0 / 0) 0% (0 / 1) 37.5% (3 / 8)
node-npmtest-rdb/node_modules/rdb/table/hasOneSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/hasOneSpec/hasOne/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/insertSpec/ 13.33% (2 / 15) 100% (0 / 0) 0% (0 / 1) 13.33% (2 / 15)
node-npmtest-rdb/node_modules/rdb/table/insertSpec/req/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/isDirtySpec/ 20% (3 / 15) 100% (0 / 0) 0% (0 / 1) 20% (3 / 15)
node-npmtest-rdb/node_modules/rdb/table/joinRelation/ 50% (8 / 16) 100% (0 / 0) 0% (0 / 1) 50% (8 / 16)
node-npmtest-rdb/node_modules/rdb/table/joinRelation/getRelativesSpec/ 18.75% (3 / 16) 100% (0 / 0) 0% (0 / 1) 18.75% (3 / 16)
node-npmtest-rdb/node_modules/rdb/table/joinRelation/joinLegToQuerySpec/ 12.5% (1 / 8) 100% (0 / 0) 0% (0 / 1) 12.5% (1 / 8)
node-npmtest-rdb/node_modules/rdb/table/joinSpec/ 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
node-npmtest-rdb/node_modules/rdb/table/joinSpec/req/ 33.33% (4 / 12) 100% (0 / 0) 0% (0 / 1) 33.33% (4 / 12)
node-npmtest-rdb/node_modules/rdb/table/logSpec/ 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
node-npmtest-rdb/node_modules/rdb/table/logSpec/req/ 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 1) 42.86% (3 / 7)
node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/ 14.29% (2 / 14) 100% (0 / 0) 0% (0 / 2) 14.29% (2 / 14)
node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isHasRelation/ 28.57% (6 / 21) 100% (0 / 0) 0% (0 / 2) 28.57% (6 / 21)
node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isJoinRelation/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/ 51.85% (14 / 27) 100% (0 / 0) 0% (0 / 3) 51.85% (14 / 27)
node-npmtest-rdb/node_modules/rdb/table/newCascadeDeleteStrategySpec/ 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
node-npmtest-rdb/node_modules/rdb/table/newCascadeDeleteStrategySpec/req/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/ 31.25% (10 / 32) 100% (0 / 0) 0% (0 / 2) 31.25% (10 / 32)
node-npmtest-rdb/node_modules/rdb/table/newGetRelatedSpec/expanded/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/ 37.5% (15 / 40) 100% (0 / 0) 0% (0 / 3) 37.5% (15 / 40)
node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/ 33.33% (13 / 39) 100% (0 / 0) 0% (0 / 2) 33.33% (13 / 39)
node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/ 33.33% (7 / 21) 100% (0 / 0) 100% (0 / 0) 33.33% (7 / 21)
node-npmtest-rdb/node_modules/rdb/table/newPrimaryKeyFilterSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/newQuerySpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/newRelatedTableSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/newRelatedTableSpec/new/ 25% (3 / 12) 100% (0 / 0) 0% (0 / 1) 25% (3 / 12)
node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/new/ 33.33% (3 / 9) 100% (0 / 0) 100% (0 / 0) 33.33% (3 / 9)
node-npmtest-rdb/node_modules/rdb/table/newThrowSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/notifyDirtySpec/ 23.08% (3 / 13) 100% (0 / 0) 0% (0 / 1) 23.08% (3 / 13)
node-npmtest-rdb/node_modules/rdb/table/nullPromiseSpec/ 23.08% (3 / 13) 100% (0 / 0) 0% (0 / 1) 23.08% (3 / 13)
node-npmtest-rdb/node_modules/rdb/table/objectToCallbackSpec/ 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
node-npmtest-rdb/node_modules/rdb/table/oneRelation/ 100% (3 / 3) 100% (0 / 0) 100% (0 / 0) 100% (3 / 3)
node-npmtest-rdb/node_modules/rdb/table/oneRelation/getRelativesSpec/ 18.75% (3 / 16) 100% (0 / 0) 0% (0 / 1) 18.75% (3 / 16)
node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/ 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/empty/ 37.5% (3 / 8) 100% (0 / 0) 0% (0 / 1) 37.5% (3 / 8)
node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/notEmpty/ 26.67% (4 / 15) 100% (0 / 0) 0% (0 / 1) 26.67% (4 / 15)
node-npmtest-rdb/node_modules/rdb/table/query/ 40% (50 / 125) 9.09% (2 / 22) 13.04% (3 / 23) 40% (50 / 125)
node-npmtest-rdb/node_modules/rdb/table/query/addSubQueries/ 38.78% (19 / 49) 0% (0 / 4) 0% (0 / 5) 38.78% (19 / 49)
node-npmtest-rdb/node_modules/rdb/table/query/extractFilterSpec/ 40% (2 / 5) 100% (0 / 0) 0% (0 / 1) 40% (2 / 5)
node-npmtest-rdb/node_modules/rdb/table/query/extractLimitSpec/ 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
node-npmtest-rdb/node_modules/rdb/table/query/extractOrderBySpec/ 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
node-npmtest-rdb/node_modules/rdb/table/query/extractSqlSpec/ 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
node-npmtest-rdb/node_modules/rdb/table/query/newSingleQuerySpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/query/parameterized/ 80% (4 / 5) 50% (1 / 2) 100% (1 / 1) 80% (4 / 5)
node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/ 27.27% (24 / 88) 0% (0 / 14) 0% (0 / 17) 27.27% (24 / 88)
node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/columnSql/ 28.95% (11 / 38) 100% (0 / 0) 0% (0 / 9) 28.95% (11 / 38)
node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/ 45.61% (26 / 57) 0% (0 / 2) 0% (0 / 10) 45.61% (26 / 57)
node-npmtest-rdb/node_modules/rdb/table/readStream/ 26% (13 / 50) 0% (0 / 10) 0% (0 / 8) 26% (13 / 50)
node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/ 58.33% (7 / 12) 100% (0 / 0) 0% (0 / 1) 58.33% (7 / 12)
node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/query/ 35.71% (15 / 42) 100% (0 / 0) 0% (0 / 10) 35.71% (15 / 42)
node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/query/singleQuery/ 23.08% (3 / 13) 0% (0 / 4) 0% (0 / 1) 23.08% (3 / 13)
node-npmtest-rdb/node_modules/rdb/table/readStream/pg/ 57.89% (11 / 19) 100% (0 / 0) 0% (0 / 2) 57.89% (11 / 19)
node-npmtest-rdb/node_modules/rdb/table/readStream/pg/query/ 32.5% (13 / 40) 100% (0 / 0) 0% (0 / 10) 32.5% (13 / 40)
node-npmtest-rdb/node_modules/rdb/table/readStream/pg/query/singleQuery/ 23.08% (3 / 13) 0% (0 / 4) 0% (0 / 1) 23.08% (3 / 13)
node-npmtest-rdb/node_modules/rdb/table/readStreamDefault/ 16.67% (4 / 24) 0% (0 / 8) 0% (0 / 2) 16.67% (4 / 24)
node-npmtest-rdb/node_modules/rdb/table/relatedTable/ 23.66% (22 / 93) 0% (0 / 6) 0% (0 / 13) 23.66% (22 / 93)
node-npmtest-rdb/node_modules/rdb/table/relation/ 27.34% (38 / 139) 0% (0 / 8) 0% (0 / 24) 27.34% (38 / 139)
node-npmtest-rdb/node_modules/rdb/table/relation/manyCache/ 41.86% (18 / 43) 100% (0 / 0) 0% (0 / 11) 41.86% (18 / 43)
node-npmtest-rdb/node_modules/rdb/table/releaseDbClientSpec/ 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
node-npmtest-rdb/node_modules/rdb/table/resultToPromiseSpec/ 40% (4 / 10) 100% (0 / 0) 0% (0 / 2) 40% (4 / 10)
node-npmtest-rdb/node_modules/rdb/table/resultToRows/ 26.63% (53 / 199) 0% (0 / 20) 0% (0 / 42) 26.63% (53 / 199)
node-npmtest-rdb/node_modules/rdb/table/resultToRows/delete/ 28.57% (6 / 21) 0% (0 / 4) 0% (0 / 5) 28.57% (6 / 21)
node-npmtest-rdb/node_modules/rdb/table/resultToRows/toDto/ 18.75% (6 / 32) 0% (0 / 6) 0% (0 / 5) 18.75% (6 / 32)
node-npmtest-rdb/node_modules/rdb/table/resultToRowsSpec/ 11.43% (4 / 35) 100% (0 / 0) 0% (0 / 2) 11.43% (4 / 35)
node-npmtest-rdb/node_modules/rdb/table/rollbackSpec/ 15.38% (2 / 13) 100% (0 / 0) 0% (0 / 1) 15.38% (2 / 13)
node-npmtest-rdb/node_modules/rdb/table/rowArray/ 20.93% (9 / 43) 0% (0 / 20) 0% (0 / 7) 20.93% (9 / 43)
node-npmtest-rdb/node_modules/rdb/table/rowArraySpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/setSessionSingletonSpec/ 20% (3 / 15) 100% (0 / 0) 0% (0 / 1) 20% (3 / 15)
node-npmtest-rdb/node_modules/rdb/table/strategyToSpanSpec/ 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
node-npmtest-rdb/node_modules/rdb/table/tryGetByIdSpec/ 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
node-npmtest-rdb/node_modules/rdb/table/tryGetFirstFromDbSpec/ 13.33% (2 / 15) 100% (0 / 0) 0% (0 / 1) 13.33% (2 / 15)
node-npmtest-rdb/node_modules/rdb/table/tryGetFromCacheByIdSpec/ 12.5% (3 / 24) 100% (0 / 0) 0% (0 / 1) 12.5% (3 / 24)
node-npmtest-rdb/node_modules/rdb/table/tryGetFromDbById/ 42.86% (3 / 7) 0% (0 / 2) 0% (0 / 2) 42.86% (3 / 7)
node-npmtest-rdb/node_modules/rdb/table/tryReleaseDbClientSpec/ 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
node-npmtest-rdb/node_modules/rdb/table/updateFieldSpec/ 15.38% (2 / 13) 100% (0 / 0) 0% (0 / 1) 15.38% (2 / 13)
node-npmtest-rdb/node_modules/rdb/tableSpec/ 66.67% (2 / 3) 100% (0 / 0) 100% (0 / 0) 66.67% (2 / 3)
node-npmtest-rdb/node_modules/rdb/tableSpec/integrationSpec/ 17.07% (14 / 82) 100% (0 / 0) 0% (0 / 13) 17.07% (14 / 82)
node-npmtest-rdb/node_modules/rdb/tableSpec/new/ 53.25% (41 / 77) 100% (0 / 0) 0% (0 / 5) 53.25% (41 / 77)
Code coverage report for node-npmtest-rdb/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/

Statements: 100% (153 / 153)      Branches: 100% (126 / 126)      Functions: 100% (28 / 28)      Lines: 100% (153 / 153)      Ignored: 26 statements, 1 function, 30 branches     

All files » node-npmtest-rdb/
File Statements Branches Functions Lines
example.js 100% (83 / 83) 100% (73 / 73) 100% (12 / 12) 100% (83 / 83)
lib.npmtest_rdb.js 100% (16 / 16) 100% (14 / 14) 100% (3 / 3) 100% (16 / 16)
test.js 100% (54 / 54) 100% (39 / 39) 100% (13 / 13) 100% (54 / 54)
Code coverage report for node-npmtest-rdb/example.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/example.js

Statements: 100% (83 / 83)      Branches: 100% (73 / 73)      Functions: 100% (12 / 12)      Lines: 100% (83 / 83)      Ignored: 26 statements, 1 function, 30 branches     

All files » node-npmtest-rdb/ » example.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328                                                  2   2         2   2   2 2 2         1             2       2       2   2               1 2           2     2     2 2   1       2     1 1 1   1 1     1 1   1     1   2           1   1   1         1 2 2 3 3 3 3 1     3 3         3       1 3 1       1 1               1   1 1 1   1   1                                                                                                                                                                                       1 1                       1     6 6   1   2   1   2         1 1   1         1             1     1 1     1 1   1 1 1 1 1 1 1   1 1   1        
/*
example.js
 
quickstart example
 
instruction
    1. save this script as example.js
    2. run the shell command:
        $ npm install npmtest-rdb && PORT=8081 node example.js
    3. play with the browser-demo on http://127.0.0.1:8081
*/
 
 
 
/* istanbul instrument in package npmtest_rdb */
/*jslint
    bitwise: true,
    browser: true,
    maxerr: 8,
    maxlen: 96,
    node: true,
    nomen: true,
    regexp: true,
    stupid: true
*/
(function () {
    'use strict';
    var local;
 
 
 
    // run shared js-env code - pre-init
    (function () {
        // init local
        local = {};
        // init modeJs
        local.modeJs = (function () {
            try {
                return typeof navigator.userAgent === 'string' &&
                    typeof document.querySelector('body') === 'object' &&
                    typeof XMLHttpRequest.prototype.open === 'function' &&
                    'browser';
            } catch (errorCaughtBrowser) {
                return module.exports &&
                    typeof process.versions.node === 'string' &&
                    typeof require('http').createServer === 'function' &&
                    'node';
            }
        }());
        // init global
        local.global = local.modeJs === 'browser'
            ? window
            : global;
        // init utility2_rollup
        local = local.global.utility2_rollup || (local.modeJs === 'browser'
            ? local.global.utility2_npmtest_rdb
            : global.utility2_moduleExports);
        // export local
        local.global.local = local;
    }());
    switch (local.modeJs) {
 
 
 
    // post-init
    // run browser js-env code - post-init
    /* istanbul ignore next */
    case 'browser':
        local.testRunBrowser = function (event) {
            Eif (!event || (event &&
                    event.currentTarget &&
                    event.currentTarget.className &&
                    event.currentTarget.className.includes &&
                    event.currentTarget.className.includes('onreset'))) {
                // reset output
                Array.from(
                    document.querySelectorAll('body > .resettable')
                ).forEach(function (element) {
                    switch (element.tagName) {
                    case 'INPUT':
                    case 'TEXTAREA':
                        element.value = '';
                        break;
                    default:
                        element.textContent = '';
                    }
                });
            }
            switch (event && event.currentTarget && event.currentTarget.id) {
            case 'testRunButton1':
                // show tests
                Eif (document.querySelector('#testReportDiv1').style.display === 'none') {
                    document.querySelector('#testReportDiv1').style.display = 'block';
                    document.querySelector('#testRunButton1').textContent =
                        'hide internal test';
                    local.modeTest = true;
                    local.testRunDefault(local);
                // hide tests
                } else {
                    document.querySelector('#testReportDiv1').style.display = 'none';
                    document.querySelector('#testRunButton1').textContent = 'run internal test';
                }
                break;
            // custom-case
            default:
                break;
            }
            Iif (document.querySelector('#inputTextareaEval1') && (!event || (event &&
                    event.currentTarget &&
                    event.currentTarget.className &&
                    event.currentTarget.className.includes &&
                    event.currentTarget.className.includes('oneval')))) {
                // try to eval input-code
                try {
                    /*jslint evil: true*/
                    eval(document.querySelector('#inputTextareaEval1').value);
                } catch (errorCaught) {
                    console.error(errorCaught);
                }
            }
        };
        // log stderr and stdout to #outputTextareaStdout1
        ['error', 'log'].forEach(function (key) {
            console[key + '_original'] = console[key];
            console[key] = function () {
                var element;
                console[key + '_original'].apply(console, arguments);
                element = document.querySelector('#outputTextareaStdout1');
                Iif (!element) {
                    return;
                }
                // append text to #outputTextareaStdout1
                element.value += Array.from(arguments).map(function (arg) {
                    return typeof arg === 'string'
                        ? arg
                        : JSON.stringify(arg, null, 4);
                }).join(' ') + '\n';
                // scroll textarea to bottom
                element.scrollTop = element.scrollHeight;
            };
        });
        // init event-handling
        ['change', 'click', 'keyup'].forEach(function (event) {
            Array.from(document.querySelectorAll('.on' + event)).forEach(function (element) {
                element.addEventListener(event, local.testRunBrowser);
            });
        });
        // run tests
        local.testRunBrowser();
        break;
 
 
 
    // run node js-env code - post-init
    /* istanbul ignore next */
    case 'node':
        // export local
        module.exports = local;
        // require modules
        local.fs = require('fs');
        local.http = require('http');
        local.url = require('url');
        // init assets
        local.assetsDict = local.assetsDict || {};
        /* jslint-ignore-begin */
        local.assetsDict['/assets.index.template.html'] = '\
<!doctype html>\n\
<html lang="en">\n\
<head>\n\
<meta charset="UTF-8">\n\
<meta name="viewport" content="width=device-width, initial-scale=1">\n\
<title>{{env.npm_package_name}} (v{{env.npm_package_version}})</title>\n\
<style>\n\
/*csslint\n\
    box-sizing: false,\n\
    universal-selector: false\n\
*/\n\
* {\n\
    box-sizing: border-box;\n\
}\n\
body {\n\
    background: #dde;\n\
    font-family: Arial, Helvetica, sans-serif;\n\
    margin: 2rem;\n\
}\n\
body > * {\n\
    margin-bottom: 1rem;\n\
}\n\
.utility2FooterDiv {\n\
    margin-top: 20px;\n\
    text-align: center;\n\
}\n\
</style>\n\
<style>\n\
/*csslint\n\
*/\n\
textarea {\n\
    font-family: monospace;\n\
    height: 10rem;\n\
    width: 100%;\n\
}\n\
textarea[readonly] {\n\
    background: #ddd;\n\
}\n\
</style>\n\
</head>\n\
<body>\n\
<!-- utility2-comment\n\
<div id="ajaxProgressDiv1" style="background: #d00; height: 2px; left: 0; margin: 0; padding: 0; position: fixed; top: 0; transition: background 0.5s, width 1.5s; width: 25%;"></div>\n\
utility2-comment -->\n\
<h1>\n\
<!-- utility2-comment\n\
    <a\n\
        {{#if env.npm_package_homepage}}\n\
        href="{{env.npm_package_homepage}}"\n\
        {{/if env.npm_package_homepage}}\n\
        target="_blank"\n\
    >\n\
utility2-comment -->\n\
        {{env.npm_package_name}} (v{{env.npm_package_version}})\n\
<!-- utility2-comment\n\
    </a>\n\
utility2-comment -->\n\
</h1>\n\
<h3>{{env.npm_package_description}}</h3>\n\
<!-- utility2-comment\n\
<h4><a download href="assets.app.js">download standalone app</a></h4>\n\
<button class="onclick onreset" id="testRunButton1">run internal test</button><br>\n\
<div id="testReportDiv1" style="display: none;"></div>\n\
utility2-comment -->\n\
\n\
\n\
\n\
<label>stderr and stdout</label>\n\
<textarea class="resettable" id="outputTextareaStdout1" readonly></textarea>\n\
<!-- utility2-comment\n\
{{#if isRollup}}\n\
<script src="assets.app.js"></script>\n\
{{#unless isRollup}}\n\
utility2-comment -->\n\
<script src="assets.utility2.rollup.js"></script>\n\
<script src="jsonp.utility2._stateInit?callback=window.utility2._stateInit"></script>\n\
<script src="assets.npmtest_rdb.rollup.js"></script>\n\
<script src="assets.example.js"></script>\n\
<script src="assets.test.js"></script>\n\
<!-- utility2-comment\n\
{{/if isRollup}}\n\
utility2-comment -->\n\
<div class="utility2FooterDiv">\n\
    [ this app was created with\n\
    <a href="https://github.com/kaizhu256/node-utility2" target="_blank">utility2</a>\n\
    ]\n\
</div>\n\
</body>\n\
</html>\n\
';
        /* jslint-ignore-end */
        Iif (local.templateRender) {
            local.assetsDict['/'] = local.templateRender(
                local.assetsDict['/assets.index.template.html'],
                {
                    env: local.objectSetDefault(local.env, {
                        npm_package_description: 'the greatest app in the world!',
                        npm_package_name: 'my-app',
                        npm_package_nameAlias: 'my_app',
                        npm_package_version: '0.0.1'
                    })
                }
            );
        } else {
            local.assetsDict['/'] = local.assetsDict['/assets.index.template.html']
                .replace((/\{\{env\.(\w+?)\}\}/g), function (match0, match1) {
                    // jslint-hack
                    String(match0);
                    switch (match1) {
                    case 'npm_package_description':
                        return 'the greatest app in the world!';
                    case 'npm_package_name':
                        return 'my-app';
                    case 'npm_package_nameAlias':
                        return 'my_app';
                    case 'npm_package_version':
                        return '0.0.1';
                    }
                });
        }
        // run the cli
        Eif (local.global.utility2_rollup || module !== require.main) {
            break;
        }
        local.assetsDict['/assets.example.js'] =
            local.assetsDict['/assets.example.js'] ||
            local.fs.readFileSync(__filename, 'utf8');
        // bug-workaround - long $npm_package_buildCustomOrg
        /* jslint-ignore-begin */
        local.assetsDict['/assets.npmtest_rdb.rollup.js'] =
            local.assetsDict['/assets.npmtest_rdb.rollup.js'] ||
            local.fs.readFileSync(
                local.npmtest_rdb.__dirname + '/lib.npmtest_rdb.js',
                'utf8'
            ).replace((/^#!/), '//');
        /* jslint-ignore-end */
        local.assetsDict['/favicon.ico'] = local.assetsDict['/favicon.ico'] || '';
        // if $npm_config_timeout_exit exists,
        // then exit this process after $npm_config_timeout_exit ms
        if (Number(process.env.npm_config_timeout_exit)) {
            setTimeout(process.exit, Number(process.env.npm_config_timeout_exit));
        }
        // start server
        if (local.global.utility2_serverHttp1) {
            break;
        }
        process.env.PORT = process.env.PORT || '8081';
        console.error('server starting on port ' + process.env.PORT);
        local.http.createServer(function (request, response) {
            request.urlParsed = local.url.parse(request.url);
            if (local.assetsDict[request.urlParsed.pathname] !== undefined) {
                response.end(local.assetsDict[request.urlParsed.pathname]);
                return;
            }
            response.statusCode = 404;
            response.end();
        }).listen(process.env.PORT);
        break;
    }
}());
 
 
Code coverage report for node-npmtest-rdb/lib.npmtest_rdb.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/lib.npmtest_rdb.js

Statements: 100% (16 / 16)      Branches: 100% (14 / 14)      Functions: 100% (3 / 3)      Lines: 100% (16 / 16)      Ignored: none     

All files » node-npmtest-rdb/ » lib.npmtest_rdb.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55                      2   2         2   2   2 2 2         1             2       2   2   2 1   1 1 1          
/* istanbul instrument in package npmtest_rdb */
/*jslint
    bitwise: true,
    browser: true,
    maxerr: 8,
    maxlen: 96,
    node: true,
    nomen: true,
    regexp: true,
    stupid: true
*/
(function () {
    'use strict';
    var local;
 
 
 
    // run shared js-env code - pre-init
    (function () {
        // init local
        local = {};
        // init modeJs
        local.modeJs = (function () {
            try {
                return typeof navigator.userAgent === 'string' &&
                    typeof document.querySelector('body') === 'object' &&
                    typeof XMLHttpRequest.prototype.open === 'function' &&
                    'browser';
            } catch (errorCaughtBrowser) {
                return module.exports &&
                    typeof process.versions.node === 'string' &&
                    typeof require('http').createServer === 'function' &&
                    'node';
            }
        }());
        // init global
        local.global = local.modeJs === 'browser'
            ? window
            : global;
        // init utility2_rollup
        local = local.global.utility2_rollup || local;
        // init lib
        local.local = local.npmtest_rdb = local;
        // init exports
        if (local.modeJs === 'browser') {
            local.global.utility2_npmtest_rdb = local;
        } else {
            module.exports = local;
            module.exports.__dirname = __dirname;
            module.exports.module = module;
        }
    }());
}());
 
 
Code coverage report for node-npmtest-rdb/test.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/test.js

Statements: 100% (54 / 54)      Branches: 100% (39 / 39)      Functions: 100% (13 / 13)      Lines: 100% (54 / 54)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197                      2   2         2   2   2 2 2         1             2     2     1       1     1   1     2           2 2   2           1           1           2 2   2           1             1       1     1             1             1 1     1             1 1 1 1 1 1     1         2 2     1             2 2     1             2 2     1             2 2     1             1 1       1 1        
/* istanbul instrument in package npmtest_rdb */
/*jslint
    bitwise: true,
    browser: true,
    maxerr: 8,
    maxlen: 96,
    node: true,
    nomen: true,
    regexp: true,
    stupid: true
*/
(function () {
    'use strict';
    var local;
 
 
 
    // run shared js-env code - pre-init
    (function () {
        // init local
        local = {};
        // init modeJs
        local.modeJs = (function () {
            try {
                return typeof navigator.userAgent === 'string' &&
                    typeof document.querySelector('body') === 'object' &&
                    typeof XMLHttpRequest.prototype.open === 'function' &&
                    'browser';
            } catch (errorCaughtBrowser) {
                return module.exports &&
                    typeof process.versions.node === 'string' &&
                    typeof require('http').createServer === 'function' &&
                    'node';
            }
        }());
        // init global
        local.global = local.modeJs === 'browser'
            ? window
            : global;
        switch (local.modeJs) {
        // re-init local from window.local
        case 'browser':
            local = local.global.utility2.objectSetDefault(
                local.global.utility2_rollup || local.global.local,
                local.global.utility2
            );
            break;
        // re-init local from example.js
        case 'node':
            local = (local.global.utility2_rollup || require('utility2'))
                .requireReadme();
            break;
        }
        // export local
        local.global.local = local;
    }());
 
 
 
    // run shared js-env code - function
    (function () {
        return;
    }());
    switch (local.modeJs) {
 
 
 
    // run browser js-env code - function
    case 'browser':
        break;
 
 
 
    // run node js-env code - function
    case 'node':
        break;
    }
 
 
 
    // run shared js-env code - post-init
    (function () {
        return;
    }());
    switch (local.modeJs) {
 
 
 
    // run browser js-env code - post-init
    case 'browser':
        local.testCase_browser_nullCase = local.testCase_browser_nullCase || function (
            options,
            onError
        ) {
        /*
         * this function will test browsers's null-case handling-behavior-behavior
         */
            onError(null, options);
        };
 
        // run tests
        local.nop(local.modeTest &&
            document.querySelector('#testRunButton1') &&
            document.querySelector('#testRunButton1').click());
        break;
 
 
 
    // run node js-env code - post-init
    /* istanbul ignore next */
    case 'node':
        local.testCase_buildApidoc_default = local.testCase_buildApidoc_default || function (
            options,
            onError
        ) {
        /*
         * this function will test buildApidoc's default handling-behavior-behavior
         */
            options = { modulePathList: module.paths };
            local.buildApidoc(options, onError);
        };
 
        local.testCase_buildApp_default = local.testCase_buildApp_default || function (
            options,
            onError
        ) {
        /*
         * this function will test buildApp's default handling-behavior-behavior
         */
            local.testCase_buildReadme_default(options, local.onErrorThrow);
            local.testCase_buildLib_default(options, local.onErrorThrow);
            local.testCase_buildTest_default(options, local.onErrorThrow);
            local.testCase_buildCustomOrg_default(options, local.onErrorThrow);
            options = [];
            local.buildApp(options, onError);
        };
 
        local.testCase_buildCustomOrg_default = local.testCase_buildCustomOrg_default ||
            function (options, onError) {
            /*
             * this function will test buildCustomOrg's default handling-behavior
             */
                options = {};
                local.buildCustomOrg(options, onError);
            };
 
        local.testCase_buildLib_default = local.testCase_buildLib_default || function (
            options,
            onError
        ) {
        /*
         * this function will test buildLib's default handling-behavior
         */
            options = {};
            local.buildLib(options, onError);
        };
 
        local.testCase_buildReadme_default = local.testCase_buildReadme_default || function (
            options,
            onError
        ) {
        /*
         * this function will test buildReadme's default handling-behavior-behavior
         */
            options = {};
            local.buildReadme(options, onError);
        };
 
        local.testCase_buildTest_default = local.testCase_buildTest_default || function (
            options,
            onError
        ) {
        /*
         * this function will test buildTest's default handling-behavior
         */
            options = {};
            local.buildTest(options, onError);
        };
 
        local.testCase_webpage_default = local.testCase_webpage_default || function (
            options,
            onError
        ) {
        /*
         * this function will test webpage's default handling-behavior
         */
            options = { modeCoverageMerge: true, url: local.serverLocalHost + '?modeTest=1' };
            local.browserTest(options, onError);
        };
 
        // run test-server
        local.testRunServer(local);
        break;
    }
}());
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/

Statements: 30.04% (67 / 223)      Branches: 0% (0 / 12)      Functions: 1.96% (1 / 51)      Lines: 30.04% (67 / 223)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/
File Statements Branches Functions Lines
createDomain.js 40% (4 / 10) 0% (0 / 2) 0% (0 / 2) 40% (4 / 10)
emitEvent.js 8.33% (2 / 24) 0% (0 / 6) 0% (0 / 7) 8.33% (2 / 24)
emptyFilter.js 47.37% (9 / 19) 100% (0 / 0) 0% (0 / 4) 47.37% (9 / 19)
index.js 29.41% (5 / 17) 0% (0 / 4) 0% (0 / 1) 29.41% (5 / 17)
lock.js 57.14% (4 / 7) 100% (0 / 0) 0% (0 / 1) 57.14% (4 / 7)
newArray.js 50% (1 / 2) 100% (0 / 0) 0% (0 / 1) 50% (1 / 2)
newCollection.js 13.33% (4 / 30) 100% (0 / 0) 0% (0 / 8) 13.33% (4 / 30)
newId.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
newImmutable.js 35.71% (5 / 14) 100% (0 / 0) 0% (0 / 4) 35.71% (5 / 14)
newObject.js 100% (3 / 3) 100% (0 / 0) 100% (1 / 1) 100% (3 / 3)
pools.js 50% (5 / 10) 100% (0 / 0) 0% (0 / 1) 50% (5 / 10)
query.js 62.5% (5 / 8) 100% (0 / 0) 0% (0 / 2) 62.5% (5 / 8)
table.js 24.36% (19 / 78) 100% (0 / 0) 0% (0 / 19) 24.36% (19 / 78)
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain.js

Statements: 40% (4 / 10)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 40% (4 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1   1                   1  
var Domain = require('domain');
var negotiateForwardProperty = require('./createDomain/negotiateForwardProperty');
 
function createDomain() {
	var oldDomain = Domain.active || {};
	var domain = Domain.create();
	var ownProperties = Object.getOwnPropertyNames(oldDomain);
	ownProperties.forEach(function(propName) {
		negotiateForwardProperty(oldDomain, domain, propName);
	});
	return domain;
}
 
module.exports = createDomain;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEvent.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEvent.js

Statements: 8.33% (2 / 24)      Branches: 0% (0 / 6)      Functions: 0% (0 / 7)      Lines: 8.33% (2 / 24)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 431                                                                                 1  
function emitEvent() {
	var callbacks = [];
	var emit = function() {
		
		var copy = callbacks.slice(0, callbacks.length);
		for (var i = 0; i < copy.length; i++) {
			var callback = copy[i];
			callback.apply(null,arguments);
		}
	};
 
	emit.add = function(callback) {
		callbacks.push(callback);
	};
 
	emit.tryAdd = function(callback) {
		if (callback)
			emit.add(callback);
	};	
 
	emit.remove = function(callback) {
		for (var i = 0; i < callbacks.length; i++) {			
			if(callbacks[i] == callback){
				callbacks.splice(i,1);
				return;
			}
		}
	};
 
	emit.tryRemove = function(callback) {
		if(callback)
			emit.remove(callback);
	};
 
	emit.clear = function() {
		callbacks = [];
	};
 
	return emit;
}
 
module.exports = emitEvent;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilter.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilter.js

Statements: 47.37% (9 / 19)      Branches: 100% (0 / 0)      Functions: 0% (0 / 4)      Lines: 47.37% (9 / 19)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 321 1 1       1 1   1               1               1       1    
var negotiateRawSqlFilter = require('./table/column/negotiateRawSqlFilter');
var parameterized = require('./table/query/newParameterized')('');
function emptyFilter() {
    return emptyFilter.and.apply(null, arguments);
}
 
emptyFilter.sql = parameterized.sql;
emptyFilter.parameters = parameterized.parameters;
 
emptyFilter.and = function(other) {
    other = negotiateRawSqlFilter(other);
    for (var i = 1; i < arguments.length; i++) {
        other = other.and(arguments[i]);
    }
    return other;
};
 
emptyFilter.or = function(other) {
    other = negotiateRawSqlFilter(other);
    for (var i = 1; i < arguments.length; i++) {
        other = other.or(arguments[i]);
    }
    return other;
};
 
emptyFilter.not = function() {
    return emptyFilter;
};
 
module.exports = emptyFilter;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/index.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/index.js

Statements: 29.41% (5 / 17)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 29.41% (5 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 224   4           4 4 4                      
var newPg = require('./pg/newDatabase');
 
var connectViaPool = function(connectionString, poolOptions) {
	if (connectionString.indexOf && connectionString.indexOf('mysql') === 0)
		return connectViaPool.mySql.apply(null, arguments);
	return newPg.apply(null, arguments);
};
 
connectViaPool.pg = newPg;
connectViaPool.mySql = require('./mySql/newDatabase');
connectViaPool.sqlite = require('./sqlite/newDatabase');
connectViaPool.table = require('./table');
connectViaPool.filter = require('./emptyFilter');
connectViaPool.commit = require('./table/commit');
connectViaPool.rollback = require('./table/rollback');
connectViaPool.end = require('./pools').end;
connectViaPool.log = require('./table/log').registerLogger;
connectViaPool.query = require('./query');
connectViaPool.lock = require('./lock');
module.exports = connectViaPool;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/lock.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lock.js

Statements: 57.14% (4 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121 1   1           1    
var query = require('./query');
var toIntKey = require('./lock/toIntKey');
 
function lock(key) {
    key = toIntKey(key);
    var sql = 'SELECT pg_advisory_xact_lock(' + key + ')';
    return query(sql);
}
 
module.exports = lock;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newArray.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newArray.js

Statements: 50% (1 / 2)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (1 / 2)      Ignored: none     

1 2 3 41      
module.exports = function() {
	return [];
};
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollection.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollection.js

Statements: 13.33% (4 / 30)      Branches: 100% (0 / 0)      Functions: 0% (0 / 8)      Lines: 13.33% (4 / 30)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 571                                         1                     1                                           1    
function newCollection() {
    var c = {};
    var initialArgs = [];
    for (var i = 0; i < arguments.length; i++) {
        initialArgs.push(arguments[i]);
    }
    var ranges = [initialArgs];
 
    c.addRange = function(otherCollection) {
        ranges.push(otherCollection);
    };
 
    c.add = function(element) {
        c.addRange([element]);
    };
 
    c.toArray = function(element) {
        var result = [];
        c.forEach(onEach);
        return result;
 
        function onEach(element) {
            result.push(element);
        }
    };
 
    c.forEach = function(callback) {
        var index = 0;
        for (var i = 0; i < ranges.length; i++) {
            ranges[i].forEach(onEach);
        }
 
        function onEach(element) {
            callback(element, index);
            index++;
        }
 
    };
 
    Object.defineProperty(c, 'length', {
        enumerable: false,
        get: function() {
        	var result = 0;
        	for (var i = 0; i < ranges.length; i++) {
        		result += ranges[i].length;
        	}
            return result;
        },
    });
 
 
    return c;
}
 
module.exports = newCollection;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newId.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newId.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 21  
module.exports = require('uuid').v4;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newImmutable.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newImmutable.js

Statements: 35.71% (5 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 4)      Lines: 35.71% (5 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231         1         1           1         1  
function newImmutable(fn) {
	var result;
	var _run = runFirst;
	return run;
 
	function run() {	
		var args = [].slice.call(arguments);	
		return _run(args);
	}
 
	function runFirst(args) {
		result =  fn.apply(null, args);
		_run = runNIgnoreArgs;
		return result;
	}
 
	function runNIgnoreArgs() {
		return result;
	}
}
 
module.exports = newImmutable;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newObject.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newObject.js

Statements: 100% (3 / 3)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (3 / 3)      Ignored: none     

1 2 3 4 5 61 2     1  
function newObject() {
	return {};
}
 
module.exports = newObject;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pools.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pools.js

Statements: 50% (5 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (5 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201 1   1         1                 1    
var promise = require('./table/promise');
var pools = require('./newObject')();
 
Object.defineProperty(pools, 'end', {
    enumerable: false,
    value: end
});
 
function end() {
    var all = [];
    for (var poolId in pools) {
    	var endPool = pools[poolId].end();
    	all.push(endPool);
    }
    return promise.all(all);
}
 
module.exports = pools;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/query.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query.js

Statements: 62.5% (5 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141 1   1         1       1  
var executeQueries = require('./table/executeQueries');
var wrapQuery = require('./query/wrapQuery');
 
function doQuery(query) {
	var wrappedQuery = wrapQuery(query);
	return executeQueries([wrappedQuery]).then(unwrapResult);
}
 
function unwrapResult(results) {
	return results[0];
}
 
module.exports = doQuery;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table.js

Statements: 24.36% (19 / 78)      Branches: 100% (0 / 0)      Functions: 0% (0 / 19)      Lines: 24.36% (19 / 78)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 1221 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1   1                                                                                               1                                                                                                           1    
var newColumn = require('./table/column/newColumn');
var column = require('./table/column');
var join = require('./table/join');
var hasMany = require('./table/hasMany');
var hasOne = require('./table/hasOne');
var getMany = require('./table/getMany');
var getById = require('./table/getById');
var tryGetById = require('./table/tryGetById');
var tryGetFirst = require('./table/tryGetFirstFromDb');
var newCache = require('./table/newRowCache');
var newContext = require('./newObject');
var insert = require('./table/insert');
var _delete = require('./table/delete');
var cascadeDelete = require('./table/cascadeDelete');
var createReadStream = require('./table/createReadStream');
var createJSONReadStream = require('./table/createJSONReadStream');
 
function _new(tableName) {
    var table = newContext();
    table._dbName = tableName;
    table._primaryColumns = [];
    table._columns = [];
    table._columnDiscriminators = [];
    table._formulaDiscriminators = [];
    table._relations = {};
    table._cache = newCache(table);
 
    table.primaryColumn = function(columnName) {
        var columnDef = newColumn(table, columnName);
        table._primaryColumns.push(columnDef);
        return column(columnDef, table);
    };
 
    table.column = function(columnName) {
        var columnDef = newColumn(table, columnName);
        return column(columnDef, table);
    };
 
    table.join = function(relatedTable) {
        return join(table, relatedTable);
    };
 
    table.hasMany = function(joinRelation) {
        return hasMany(joinRelation);
    };
 
    table.hasOne = function(joinRelation) {
        return hasOne(joinRelation);
    };
 
    table.getMany = function(filter, strategy) {
        return getMany(table, filter, strategy);
    };
 
    table.getMany.exclusive = function(filter, strategy) {
        return getMany.exclusive(table, filter, strategy);
    };
 
    table.tryGetFirst = function() {
        return call(tryGetFirst, arguments);
    };
    table.tryGetFirst.exclusive = function() {
        return call(tryGetFirst.exclusive, arguments);
    };
 
    function call(func, args) {
        var mergedArgs = [table];
        for (var i = 0; i < args.length; i++) {
            mergedArgs.push(args[i]);
        }
        return func.apply(null, mergedArgs);
    }
 
    table.getById = function() {
        return call(getById, arguments);
    };
    table.getById.exclusive = function() {
        return call(getById.exclusive, arguments);
    };
 
 
    table.tryGetById = function() {
        return call(tryGetById, arguments);
    };
 
    table.tryGetById.exclusive = function() {
        return call(tryGetById.exclusive, arguments);
    };
 
    table.columnDiscriminators = function() {
        for (var i = 0; i < arguments.length; i++) {
            table._columnDiscriminators.push(arguments[i]);
        }
        return table;
    };
 
    table.formulaDiscriminators = function() {
        for (var i = 0; i < arguments.length; i++) {
            table._formulaDiscriminators.push(arguments[i]);
        }
        return table;
    };
 
    table.insert = function() {
        return call(insert, arguments);
    };
 
    table.delete = _delete.bind(null, table);
    table.cascadeDelete = cascadeDelete.bind(null, table);
 
    table.createReadStream = createReadStream.bind(null, table);
    table.createJSONReadStream = createJSONReadStream.bind(null, table);
    table.exclusive = function() {
        table._exclusive = true;
        return table;
    };
    return table;
}
 
module.exports = _new;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/

Statements: 30.77% (4 / 13)      Branches: 0% (0 / 4)      Functions: 0% (0 / 5)      Lines: 36.36% (4 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/createDomain/
File Statements Branches Functions Lines
negotiateForwardProperty.js 30.77% (4 / 13) 0% (0 / 4) 0% (0 / 5) 36.36% (4 / 11)
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardProperty.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardProperty.js

Statements: 30.77% (4 / 13)      Branches: 0% (0 / 4)      Functions: 0% (0 / 5)      Lines: 36.36% (4 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241                   1           1           1  
function negotiateForwardProperty(oldDomain, newDomain, propertyName) {
	if(newDomain[propertyName]) return;
	if (propertyName === 'rdb') return;
	Object.defineProperty(newDomain, propertyName, {
		enumerable: true,
		get: createGetter(oldDomain, propertyName),
		set: createSetter(oldDomain, propertyName)
	});
}
 
function createGetter(oldDomain, propName) {
	return function() {
		return oldDomain[propName];
	};
}
 
function createSetter(oldDomain, propName) {
	return function(value) {
		oldDomain[propName] = value;
	};
}
 
module.exports = negotiateForwardProperty;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/

Statements: 16.98% (9 / 53)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 16.98% (9 / 53)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/
File Statements Branches Functions Lines
negotiateExisting.js 13.33% (2 / 15) 100% (0 / 0) 0% (0 / 1) 13.33% (2 / 15)
negotiateFoo.js 12.5% (2 / 16) 100% (0 / 0) 0% (0 / 1) 12.5% (2 / 16)
negotiateRdb.js 15.38% (2 / 13) 100% (0 / 0) 0% (0 / 1) 15.38% (2 / 13)
whenNegotiateExisting.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenNegotiateFoo.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenNegotiateRdb.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/negotiateExisting.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/negotiateExisting.js

Statements: 13.33% (2 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 13.33% (2 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 222   1                                      
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.newDomain = {};
	c.oldDomain = {};
 
	c.oldFoo = {};
	c.existingFoo = {};
	c.oldDomain.foo = c.oldFoo;
	c.newDomain.foo = c.existingFoo;
	c.propertyName = 'foo';
 
	require('../negotiateForwardProperty')(c.oldDomain, c.newDomain, c.propertyName);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/negotiateFoo.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/negotiateFoo.js

Statements: 12.5% (2 / 16)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 12.5% (2 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 232   1                                        
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.newDomain = {};
	c.oldDomain = {};
 
	c.oldFoo = {};
	c.newFoo = {};
	c.oldDomain.foo = c.oldFoo;
	c.propertyName = 'foo';
 
	require('../negotiateForwardProperty')(c.oldDomain, c.newDomain, c.propertyName);
	c.originalValue = c.newDomain.foo;
	c.newDomain.foo = c.newFoo;
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/negotiateRdb.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/negotiateRdb.js

Statements: 15.38% (2 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 15.38% (2 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 212   1                                    
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.newDomain = {};
	c.oldDomain = {};
 
	c.oldRdb = {};
	c.oldDomain.rdb = c.oldRdb;
	c.propertyName = 'rdb';
 
	require('../negotiateForwardProperty')(c.oldDomain, c.newDomain, c.propertyName);
 
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/whenNegotiateExisting.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/whenNegotiateExisting.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
    .it('should not forward existing').assertEqual(c.newDomain.foo, c.existingFoo)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/whenNegotiateFoo.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/whenNegotiateFoo.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
    .it('should forward property getter through new domain').assertEqual(c.oldFoo, c.originalValue)
    .it('should update value on old domain when setting on new domain').assertEqual(c.newFoo, c.oldDomain.foo)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/whenNegotiateRdb.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomain/negotiateForwardPropertySpec/whenNegotiateRdb.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
    .it('should not forward rdb').assertNotEqual(c.oldDomain.rdb, c.newDomain.rdb)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomainSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomainSpec/

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/createDomainSpec/
File Statements Branches Functions Lines
req.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomainSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomainSpec/req.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 162   1                          
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.Domain = c.requireMock('domain');
	c.negotiateForwardProperty = c.requireMock('./createDomain/negotiateForwardProperty');
 
	c.sut = require('../createDomain');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomainSpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomainSpec/req/

Statements: 20% (6 / 30)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 20% (6 / 30)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/createDomainSpec/req/
File Statements Branches Functions Lines
inDomain.js 11.76% (2 / 17) 100% (0 / 0) 0% (0 / 1) 11.76% (2 / 17)
outsideDomain.js 28.57% (2 / 7) 100% (0 / 0) 0% (0 / 1) 28.57% (2 / 7)
whenInDomain.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenOutsideDomain.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomainSpec/req/inDomain.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomainSpec/req/inDomain.js

Statements: 11.76% (2 / 17)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 11.76% (2 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 262   1                                              
var a = require('a');
 
function act(c) {
	c.domain = {};
	c.Domain.active = c.domain;
 
	c.newDomain = {};
	c.Domain.create = c.mock();
	c.Domain.create.expect().return(c.newDomain);
 
	c.newBar = {};
	c.baz = {};
 
	c.domain.foo = {};
	c.domain.bar = {};
	c.domain.baz = {};
 
	c.negotiateForwardProperty.expect(c.domain, c.newDomain, 'foo');
	c.negotiateForwardProperty.expect(c.domain, c.newDomain, 'bar');
	c.negotiateForwardProperty.expect(c.domain, c.newDomain, 'baz');
	
	c.returned = c.sut();
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomainSpec/req/outsideDomain.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomainSpec/req/outsideDomain.js

Statements: 28.57% (2 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 28.57% (2 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 132   1                    
var a = require('a');
 
function act(c) {
	c.Domain.create = c.mock();
 
	c.newDomain = {};
	c.Domain.create.expect().return(c.newDomain);
 
	c.returned = c.sut();
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomainSpec/req/whenInDomain.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomainSpec/req/whenInDomain.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
.it('should forward properties of old domain').assertDoesNotThrow(c.negotiateForwardProperty.verify)
.it('should return new domain').assertEqual(c.newDomain, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomainSpec/req/whenOutsideDomain.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/createDomainSpec/req/whenOutsideDomain.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
.it('should return a new domain').assertEqual(c.newDomain, c.returned)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/

Statements: 50% (2 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (2 / 4)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/emitEventSpec/
File Statements Branches Functions Lines
new.js 50% (2 / 4) 100% (0 / 0) 0% (0 / 1) 50% (2 / 4)
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new.js

Statements: 50% (2 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (2 / 4)      Ignored: none     

1 2 3 4 5 6 71         1  
function act(c) {
	c.mock = require('a').mock;
	c.sut = require('../emitEvent')();
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/

Statements: 50% (25 / 50)      Branches: 100% (0 / 0)      Functions: 0% (0 / 6)      Lines: 50% (25 / 50)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/
File Statements Branches Functions Lines
add.js 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 1) 42.86% (3 / 7)
emit.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
tryAdd.js 57.14% (4 / 7) 100% (0 / 0) 0% (0 / 1) 57.14% (4 / 7)
tryAddEmpty.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
tryRemove.js 57.14% (4 / 7) 100% (0 / 0) 0% (0 / 1) 57.14% (4 / 7)
tryRemoveEmpty.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
whenEmit.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenTryAdd.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenTryAddEmpty.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenTryRemove.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenTryRemoveEmpty.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/add.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/add.js

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11  1             1 1  
 
function act(c) {
	c.callback = c.mock();
	c.callback2 = c.mock();
	c.sut.add(c.callback);
	c.sut.add(c.callback2);
}
 
act.base = '../new';
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/emit.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/emit.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 71       1 1  
function act(c) {
	c.sut();
}
 
act.base = '../new';
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/tryAdd.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/tryAdd.js

Statements: 57.14% (4 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111   1           1 1  
var callback = 'foo';
 
function act(c) {	
	c.sut.add = c.mock();
	c.sut.add.expect(callback);
	c.sut.tryAdd(callback);
}
 
act.base = '../new';
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/tryAddEmpty.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/tryAddEmpty.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9  1         1 1  
 
function act(c) {	
	c.sut.add = c.mock();
	c.sut.tryAdd();
}
 
act.base = '../new';
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/tryRemove.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/tryRemove.js

Statements: 57.14% (4 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111   1           1 1  
var callback = 'foo';
 
function act(c) {	
	c.sut.remove = c.mock();
	c.sut.remove.expect(callback);
	c.sut.tryRemove(callback);
}
 
act.base = '../new';
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/tryRemoveEmpty.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/tryRemoveEmpty.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9  1         1 1  
 
function act(c) {	
	c.sut.remove = c.mock();
	c.sut.tryRemove();
}
 
act.base = '../new';
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/whenEmit.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/whenEmit.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('should not crash').assertOk('ok');
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/whenTryAdd.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/whenTryAdd.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('forward to add').assertDoesNotThrow(c.sut.add.verify);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/whenTryAddEmpty.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/whenTryAddEmpty.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('not forward to add').assertDoesNotThrow(c.sut.add.verify);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/whenTryRemove.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/whenTryRemove.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('forward to remove').assertDoesNotThrow(c.sut.remove.verify);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/whenTryRemoveEmpty.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/whenTryRemoveEmpty.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('should not forward to remove').assertDoesNotThrow(c.sut.remove.verify);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/add/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/add/

Statements: 63.64% (7 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 63.64% (7 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/add/
File Statements Branches Functions Lines
clear.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
remove.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
whenEmit.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/add/clear.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/add/clear.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 71       1 1  
function act(c) {
	c.sut.clear();
}
 
act.base = '../add';
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/add/remove.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/add/remove.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 71       1 1  
function act(c) {
	c.sut.remove(c.callback);
}
 
act.base = '../add';
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/add/whenEmit.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emitEventSpec/new/add/whenEmit.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should invoke callback').assertDoesNotThrow(c.callback.verify)
	.it('should invoke callback2').assertDoesNotThrow(c.callback2.verify);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/

Statements: 15.79% (3 / 19)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 15.79% (3 / 19)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/
File Statements Branches Functions Lines
req.js 12.5% (2 / 16) 100% (0 / 0) 0% (0 / 1) 12.5% (2 / 16)
whenReq.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req.js

Statements: 12.5% (2 / 16)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 12.5% (2 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 222       1                                  
var a = require('a');
var requireMock = a.requireMock;
var mock = a.mock;
 
function act(c) {	
	c.mock = mock;
	c.negotiateRawSqlFilter = requireMock('./table/column/negotiateRawSqlFilter');
	
	c.newParameterized =  requireMock('./table/query/newParameterized');
	c.parameterized = {};
	c.newParameterized.expect('').return(c.parameterized);
	c.sql = {};
	c.parameterized.sql = c.sql;
	c.parameters = {};
	c.parameterized.parameters = c.parameters;
	c.input = {};
 
	c.sut = require('../emptyFilter');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/whenReq.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/whenReq.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('parameters points at parameterized.parameters').assertEqual( c.parameters, c.sut.parameters)
	.it('sql points at parameterized.sql').assertEqual( c.sql, c.sut.sql)
	.it('not returns self').assertEqual( c.sut, c.sut.not())
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req/

Statements: 22.58% (7 / 31)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 22.58% (7 / 31)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req/
File Statements Branches Functions Lines
and.js 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
or.js 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
whenAnd.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenOr.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req/and.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req/and.js

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171                             1  
function act(c){
	c.filter = {};
	c.filter2 = {};
	c.initialFilter = {};
	c.initialFilter2 = {};
	c.expected = {};
 
	c.negotiateRawSqlFilter.expect(c.initialFilter).return(c.filter);
 
	c.filter.and = c.mock();
	c.filter.and.expect(c.initialFilter2).return(c.expected);
 
	c.returned = c.sut.and(c.initialFilter, c.initialFilter2);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req/or.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req/or.js

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171                             1  
function act(c){
	c.filter = {};
	c.filter2 = {};
	c.initialFilter = {};
	c.initialFilter2 = {};
	c.expected = {};
 
	c.negotiateRawSqlFilter.expect(c.initialFilter).return(c.filter);
 
	c.filter.or = c.mock();
	c.filter.or.expect(c.initialFilter2).return(c.expected);
 
	c.returned = c.sut.or(c.initialFilter, c.initialFilter2);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req/whenAnd.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req/whenAnd.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return negotiatedFilter').assertEqual(c.expected, c.returned)
	
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return negotiatedFilter').assertEqual(c.expected, c.returned)
	
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req/whenOr.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/emptyFilterSpec/req/whenOr.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return negotiatedFilter').assertEqual(c.expected, c.returned)
	
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/

Statements: 13.04% (3 / 23)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 13.04% (3 / 23)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/indexSpec/
File Statements Branches Functions Lines
req.js 10% (2 / 20) 100% (0 / 0) 0% (0 / 1) 10% (2 / 20)
whenReq.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req.js

Statements: 10% (2 / 20)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 10% (2 / 20)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 292       1                                                
var a = require('a');
var mock = a.mock;
var requireMock = a.requireMock;
 
function act(c) {
    c.emptyFilter = requireMock('./emptyFilter');
    c.mock = mock;
    c.table = requireMock('./table');
    c.commit = requireMock('./table/commit');
    c.rollback = requireMock('./table/rollback');
    c.pools = requireMock('./pools');
    c.log = requireMock('./table/log');
    c.log.registerLogger = {};
 
    c.newDatabase = requireMock('./pg/newDatabase');
    c.newMySqlDatabase = requireMock('./mySql/newDatabase');
    c.newSqliteDatabase = requireMock('./sqlite/newDatabase');
 
    c.query = requireMock('./query');
    c.lock = requireMock('./lock');
 
    c.pools.end = {};
 
    c.sut = require('../index');
}
 
module.exports = act;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/whenReq.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/whenReq.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 172                                
var when = require('a').when;
var c = {};
 
when(c)
    .it('should expose emptyFilter as filter').assertEqual(c.emptyFilter, c.sut.filter)
    .it('should expose table').assertEqual(c.table, c.sut.table)
    .it('should expose command').assertEqual(c.command, c.sut.command)
    .it('should expose rollback').assertEqual(c.rollback, c.sut.rollback)
    .it('should set mySql').assertEqual(c.newMySqlDatabase, c.sut.mySql)
    .it('should set pg').assertEqual(c.newDatabase, c.sut.pg)
    .it('should set end').assertEqual(c.pools.end, c.sut.end)
    .it('should set log to registerLogger').assertEqual(c.log.registerLogger, c.sut.log)
    .it('should expose query').assertEqual(c.query, c.sut.query)
    .it('should expose lock').assertEqual(c.lock, c.sut.lock)
    
    
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/mySql/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/mySql/

Statements: 50% (5 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (5 / 10)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/indexSpec/req/mySql/
File Statements Branches Functions Lines
defineDb.js 57.14% (4 / 7) 100% (0 / 0) 0% (0 / 1) 57.14% (4 / 7)
whenDefineDb.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/mySql/defineDb.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/mySql/defineDb.js

Statements: 57.14% (4 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111 1   1           1  
var connString = 'mysql...';
var poolOptions = {};
 
function act(c){	
	c.database = {};
	c.newMySqlDatabase.expect(connString, poolOptions).return(c.database);
	c.returned = c.sut(connString, poolOptions);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/mySql/whenDefineDb.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/mySql/whenDefineDb.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return database').assertEqual(c.database, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/other/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/other/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/indexSpec/req/other/
File Statements Branches Functions Lines
whenDefineDb.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/other/whenDefineDb.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/other/whenDefineDb.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return database').assertEqual(c.database, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/pg/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/pg/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/indexSpec/req/pg/
File Statements Branches Functions Lines
whenDefineDb.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/pg/whenDefineDb.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/pg/whenDefineDb.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return database').assertEqual(c.database, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/sqllite/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/sqllite/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/indexSpec/req/sqllite/
File Statements Branches Functions Lines
whenDefineDb.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/sqllite/whenDefineDb.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/indexSpec/req/sqllite/whenDefineDb.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return database').assertEqual(c.database, c.returned)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/

Statements: 20% (5 / 25)      Branches: 0% (0 / 12)      Functions: 0% (0 / 4)      Lines: 20% (5 / 25)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/lock/
File Statements Branches Functions Lines
toIntKey.js 20% (5 / 25) 0% (0 / 12) 0% (0 / 4) 20% (5 / 25)
Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKey.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKey.js

Statements: 20% (5 / 25)      Branches: 0% (0 / 12)      Functions: 0% (0 / 4)      Lines: 20% (5 / 25)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 371                             1           1       1                 1    
function toIntKey(key) {
    if (isInteger())
        return key;
    if (isIntegerString())
        return trim(key);
    var intKey = '';
    for (var i = 0; i < key.length; ++i) {
        var value = key[i].toUpperCase();
        value = parseInt(value, 16);
        if (!isNaN(value))
            intKey += value;
    }
 
    return trim(intKey);
 
    function isIntegerString() {
        var pattern = /^-?\d+\.?\d*$/
        var reg = new RegExp(pattern);
        return (typeof key == 'string' && reg.test(key));
    }
 
    function isInteger() {
        return (typeof key == 'number') && (Math.floor(key) === key);
    }
 
    function trim(value) {
        var maxBigInt = '9223372036854775807';
        value = value.substring(0, 19);
        if (value > maxBigInt) 
            return value.substring(0,18);
        return value;
    }
}
 
module.exports = toIntKey;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/
File Statements Branches Functions Lines
req.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 132   1                    
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.sut = require('../toIntKey');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/

Statements: 37.04% (10 / 27)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 37.04% (10 / 27)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/
File Statements Branches Functions Lines
aboveMax.js 40% (2 / 5) 100% (0 / 0) 0% (0 / 1) 40% (2 / 5)
integer.js 40% (2 / 5) 100% (0 / 0) 0% (0 / 1) 40% (2 / 5)
integerString.js 40% (2 / 5) 100% (0 / 0) 0% (0 / 1) 40% (2 / 5)
whenAboveMax.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenInteger.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenIntegerString.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenString.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/aboveMax.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/aboveMax.js

Statements: 40% (2 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 91           1    
function act(c) {
    c.key = '9223372036854775808';
    c.expected = '922337203685477580';
    c.returned = c.sut(c.key);
}
 
module.exports = act;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/integer.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/integer.js

Statements: 40% (2 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 91             1  
function act(c){
	c.key = 1234567890;
	c.expected = c.key;
 
	c.returned =  c.sut(c.key);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/integerString.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/integerString.js

Statements: 40% (2 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 91             1  
function act(c){
	c.key = '1234567890';
	c.expected = c.key;
	
	c.returned =  c.sut(c.key);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/whenAboveMax.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/whenAboveMax.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return lock object').assertEqual(c.expected, c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/whenInteger.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/whenInteger.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return lock object').assertEqual(c.expected, c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/whenIntegerString.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/whenIntegerString.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return lock object').assertEqual(c.expected, c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/whenString.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lock/toIntKeySpec/req/whenString.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return lock object').assertEqual(c.expected, c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/lockSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lockSpec/

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/lockSpec/
File Statements Branches Functions Lines
req.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
Code coverage report for node-npmtest-rdb/node_modules/rdb/lockSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lockSpec/req.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 162   1                          
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.query = c.requireMock('./query');	
	c.toIntKey = c.requireMock('./lock/toIntKey');
 
	c.sut = require('../lock');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/lockSpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lockSpec/req/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/lockSpec/req/
File Statements Branches Functions Lines
whenLock.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/lockSpec/req/whenLock.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/lockSpec/req/whenLock.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return lock object').assertEqual(c.expected, c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/

Statements: 42.57% (43 / 101)      Branches: 0% (0 / 4)      Functions: 0% (0 / 17)      Lines: 42.57% (43 / 101)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/mySql/
File Statements Branches Functions Lines
deleteFromSql.js 66.67% (4 / 6) 100% (0 / 0) 0% (0 / 1) 66.67% (4 / 6)
encodeDate.js 42.86% (3 / 7) 0% (0 / 2) 0% (0 / 2) 42.86% (3 / 7)
newDatabase.js 42.31% (11 / 26) 100% (0 / 0) 0% (0 / 5) 42.31% (11 / 26)
newPool.js 47.06% (8 / 17) 100% (0 / 0) 0% (0 / 1) 47.06% (8 / 17)
newTransaction.js 32% (8 / 25) 0% (0 / 2) 0% (0 / 3) 32% (8 / 25)
selectForUpdateSql.js 50% (1 / 2) 100% (0 / 0) 0% (0 / 1) 50% (1 / 2)
wrapQuery.js 36.36% (4 / 11) 100% (0 / 0) 0% (0 / 2) 36.36% (4 / 11)
wrapQueryStream.js 57.14% (4 / 7) 100% (0 / 0) 0% (0 / 2) 57.14% (4 / 7)
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/deleteFromSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/deleteFromSql.js

Statements: 66.67% (4 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 101 1   1       1    
var format = 'delete %s from %s as %s%s';
var util = require('util');
 
function deleteFromSql(table, alias, whereSql) {
    var name = table._dbName;
    return util.format(format, alias, name, alias, whereSql);
}
module.exports = deleteFromSql;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDate.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDate.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111         1       1  
function encodeDate (date) {
	if (date.toISOString)
		return truncate(date.toISOString());
	return truncate(date);
}
function truncate(date) {
	return "'" + date.substring(0,23) + "'"
}
 
module.exports = encodeDate;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabase.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabase.js

Statements: 42.31% (11 / 26)      Branches: 100% (0 / 0)      Functions: 0% (0 / 5)      Lines: 42.31% (11 / 26)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 401 1 1 1 1 1 1 1   1               1                                         1  
var createDomain = require('../createDomain');
var newTransaction = require('./newTransaction');
var newPromise = require('../table/promise');
var begin = require('../table/begin');
var newPool = require('./newPool');
var commit = require('../table/commit');
var rollback = require('../table/rollback');
var lock = require('../lock');
 
function newDatabase(connectionString, poolOptions) {
    var c = {};
    var pool = newPool(connectionString, poolOptions);
 
    c.transaction = function() {
        var domain = createDomain();
        return domain.run(onRun);
 
        function onRun() {
            var transaction = newTransaction(domain, pool);
            return newPromise(transaction).then(begin);
        }
    };
 
    c.commit = commit;
    c.rollback = rollback;
    c.lock = lock;
    
    c.end = function() {
        return pool.end();
    };
 
    c.accept = function(caller) {
        caller.visitMySql();
    };
 
    return c;
}
 
module.exports = newDatabase;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newPool.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newPool.js

Statements: 47.06% (8 / 17)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 47.06% (8 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221 1 1 1 1 1   1                         1  
var pools = require('../pools');
var promise = require('../table/promise');
var end = require('./pool/end');
var mysql = require('mysql');
var newId = require('../newId');
var negotiatePoolOptions = require('./pool/negotiatePoolOptions');
 
function newPool(connectionString, poolOptions) {
	var pool = mysql.createPool(connectionString);
	negotiatePoolOptions(pool, poolOptions);
	var id = newId();
	var boundEnd = end.bind(null, pool, id);
	var c = {};
 
	c.connect = pool.getConnection.bind(pool);
	c.end = promise.denodeify(boundEnd);
	pools[id] = c;
	return c;
}
 
module.exports = newPool;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newTransaction.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newTransaction.js

Statements: 32% (8 / 25)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 32% (8 / 25)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351 1 1 1 1   1         1                                           1  
var wrapQuery = require('./wrapQuery');
var wrapQueryStream = require('./wrapQueryStream');
var deleteFromSql = require('./deleteFromSql');
var selectForUpdateSql = require('./selectForUpdateSql');
var encodeDate = require('./encodeDate');
 
function newResolveTransaction(domain, pool) {
 
    return function(onSuccess, onError) {
        pool.connect(onConnected);
 
        function onConnected(err, connection) {
            if (err) {
                onError(err);
                return;
            }
            var rdb = {};
            connection.executeQuery = wrapQuery(connection);
            connection.streamQuery = wrapQueryStream(connection);
 
            rdb.dbClient = connection;
            rdb.dbClientDone = connection.release.bind(connection);
            rdb.encodeBoolean = connection.escape.bind(connection);
            rdb.encodeDate = encodeDate;
            rdb.deleteFromSql = deleteFromSql;
            rdb.selectForUpdateSql = selectForUpdateSql;
            rdb.multipleStatements = true;
            domain.rdb = rdb;    
            onSuccess();
        }
    };
}
 
module.exports = newResolveTransaction;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/selectForUpdateSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/selectForUpdateSql.js

Statements: 50% (1 / 2)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (1 / 2)      Ignored: none     

1 2 3 41      
module.exports = function(alias) {
	return ' FOR UPDATE';
}
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQuery.js

Statements: 36.36% (4 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 36.36% (4 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181   1       1                   1  
var log = require('../table/log');
 
function wrapQuery(connection) {
	var runOriginalQuery = connection.query;
	return runQuery;
 
	function runQuery(query, onCompleted) {
		var params = query.parameters;
		var sql = query.sql();
		log(sql);
		log('parameters: ' + params);
		return runOriginalQuery.call(connection, sql, params, onCompleted);
	}
 
}
 
module.exports = wrapQuery;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQueryStream.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQueryStream.js

Statements: 57.14% (4 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131   1       1         1  
var log = require('../table/log');
 
function wrapQueryStream(connection) {
	var runOriginalQuery = connection.query;
	return runQuery;
 
	function runQuery(query, options) {
		return connection.executeQuery(query).stream(options);	
	}
}
 
module.exports = wrapQueryStream;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/
File Statements Branches Functions Lines
req.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/req.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 142   1                      
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
 
	c.sut = require('../encodeDate');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/req/

Statements: 25% (6 / 24)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 25% (6 / 24)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/req/
File Statements Branches Functions Lines
encode.js 28.57% (2 / 7) 100% (0 / 0) 0% (0 / 2) 28.57% (2 / 7)
encodeString.js 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
whenEncode.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenEncodeString.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/req/encode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/req/encode.js

Statements: 28.57% (2 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 28.57% (2 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141                       1  
function act(c){
	var valueAsText = '2014-02-16T06:49:40.297-0200';
	c.expected = "'2014-02-16T06:49:40.297'";
	c.date = {
		toISOString: function() {
			return valueAsText;
		}
	};
		
	c.returned = c.sut(c.date);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/req/encodeString.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/req/encodeString.js

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181                               1  
function act(c){
 
	c.dateText = '2014-02-16T06:49:40.297+0200';
	c.expected = "'2014-02-16T06:49:40.297'";
 
	c.dateText2 = '2014-02-16T06:49:40.297-0200';
	c.expected2 = "'2014-02-16T06:49:40.297'";
 
	c.dateText3 = '2014-02-16T06:49:40.297Z';
	c.expected3 = "'2014-02-16T06:49:40.297'";
	
	c.returned = c.sut(c.dateText);
	c.returned2 = c.sut(c.dateText2);
	c.returned3 = c.sut(c.dateText3);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/req/whenEncode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/req/whenEncode.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return ISO').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/req/whenEncodeString.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/encodeDateSpec/req/whenEncodeString.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return ISO without time zone for plus zone').assertEqual(c.expected, c.returned)
	.it('should return ISO without time zone for minus zone').assertEqual(c.expected2, c.returned2)
	.it('should return ISO without time zone for zulu zone').assertEqual(c.expected3, c.returned3)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should set commit on transaction').assertEqual(c.commit, c.sut.commit)
	.it('should set rollback on transaction').assertEqual(c.rollback, c.sut.rollback)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/new/

Statements: 23.53% (8 / 34)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 23.53% (8 / 34)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/new/
File Statements Branches Functions Lines
accept.js 33.33% (2 / 6) 100% (0 / 0) 0% (0 / 1) 33.33% (2 / 6)
transaction.js 15.79% (3 / 19) 0% (0 / 2) 0% (0 / 2) 15.79% (3 / 19)
whenAccept.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenEnd.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenTransaction.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/new/accept.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/new/accept.js

Statements: 33.33% (2 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 33.33% (2 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111                 1  
function act(c){
 
	c.context = {};
	c.context.visitMySql = c.mock();
	c.context.visitMySql.expect();
	
	c.sut.accept(c.context);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/new/transaction.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/new/transaction.js

Statements: 15.79% (3 / 19)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 15.79% (3 / 19)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 281                               1                   1  
function act(c){
	c.expected = {};
	c.resolveTransaction = {};
	c.transactionPromise = {};
	c.domain = {};
	c.createDomain.expect().return(c.domain);
	c.newTransaction.expect(c.domain, c.pool).return(c.resolveTransaction);
	c.newPromise.expect(c.resolveTransaction).return(c.transactionPromise);
 
	c.transactionPromise.then = c.mock();
	c.beginPromise = {};
	c.transactionPromise.then.expect(c.begin).return(c.beginPromise);
 
	c.domain.run = c.mock();
	c.domain.run.expectAnything().whenCalled(onRun).return(c.expected);
 
	function onRun(cb) {
		var res = cb();
		if (res != c.beginPromise)
			throw new Error('wrong result');
	}
 
	c.returned = c.sut.transaction();
 
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/new/whenAccept.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/new/whenAccept.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should visit').assertDoesNotThrow(c.context.visitMySql.verify)
	
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/new/whenEnd.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/new/whenEnd.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should end pool').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/new/whenTransaction.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newDatabaseSpec/new/whenTransaction.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return new transaction').assertEqual(c.expected, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newPoolSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newPoolSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/mySql/newPoolSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newPoolSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newPoolSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 102                  
var when = require('a').when;
var c = {};
 
when(c)
    .it('should negotiate pool options').assertDoesNotThrow(c.negotiatePoolOptions.verify)
    .it('should set end').assertEqual(c.denodeifiedEndPool, c.sut.end)
    .it('should set connect').assertEqual(c.boundGetConnection, c.sut.connect)
    .it('should add pool to pools').assertDeepEqual(c.pools[c.id], c.sut)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newTransactionSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newTransactionSpec/new/

Statements: 30.77% (4 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 30.77% (4 / 13)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/mySql/newTransactionSpec/new/
File Statements Branches Functions Lines
runDomain.js 30% (3 / 10) 100% (0 / 0) 0% (0 / 3) 30% (3 / 10)
whenRunDomain.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newTransactionSpec/new/runDomain.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newTransactionSpec/new/runDomain.js

Statements: 30% (3 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 30% (3 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191             1                 1    
function act(c) {
 
	c.pool.connect = c.mock();
	c.pool.connect.expectAnything().whenCalled(onConnected);
 
    c.raiseConnected = function() {};
 
	function onConnected(cb) {
		c.raiseConnected = cb;
	}
 
	c.onSuccess = c.mock();
	c.onError = c.mock();
    c.sut(c.onSuccess, c.onError);
}
 
module.exports = act;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newTransactionSpec/new/whenRunDomain.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/newTransactionSpec/new/whenRunDomain.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('should connect').assertDoesNotThrow(c.pool.connect.verify)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/pool/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/pool/

Statements: 40% (6 / 15)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 40% (6 / 15)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/mySql/pool/
File Statements Branches Functions Lines
end.js 57.14% (4 / 7) 100% (0 / 0) 0% (0 / 2) 57.14% (4 / 7)
negotiatePoolOptions.js 25% (2 / 8) 0% (0 / 2) 0% (0 / 1) 25% (2 / 8)
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/pool/end.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/pool/end.js

Statements: 57.14% (4 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141   1     1           1    
var pools = require('../../pools');
 
function endPool(mysqlPool, id, done) {	
    mysqlPool.end(onEnd);
 
    function onEnd() {
        delete pools[id];
        done.apply(null, arguments);
    }
}
 
module.exports = endPool;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/pool/negotiatePoolOptions.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/pool/negotiatePoolOptions.js

Statements: 25% (2 / 8)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131                     1  
function negotiatePoolOptions(pool, options) {
	var config = pool.config;
	for(var name in options) {
		var value = options[name];
		if (name === 'size')
			config.connectionLimit = value;
		else
			config[name] = value;
	}
}
 
module.exports = negotiatePoolOptions;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/pool/endSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/pool/endSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/mySql/pool/endSpec/
File Statements Branches Functions Lines
whenEnd.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/pool/endSpec/whenEnd.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/pool/endSpec/whenEnd.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should start ending').assertDoesNotThrow(c.mysqlPool.end.verify)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/selectForUpdateSqlSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/selectForUpdateSqlSpec/

Statements: 27.27% (3 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 27.27% (3 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/mySql/selectForUpdateSqlSpec/
File Statements Branches Functions Lines
getSql.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
whenGetSql.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/selectForUpdateSqlSpec/getSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/selectForUpdateSqlSpec/getSql.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 132   1                    
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.returned = require('../selectForUpdateSql')('alias');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/selectForUpdateSqlSpec/whenGetSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/selectForUpdateSqlSpec/whenGetSql.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
.it('should return sql').assertEqual(' FOR UPDATE', c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQuerySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQuerySpec/

Statements: 16.67% (2 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/mySql/wrapQuerySpec/
File Statements Branches Functions Lines
wrap.js 16.67% (2 / 12) 100% (0 / 0) 0% (0 / 1) 16.67% (2 / 12)
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQuerySpec/wrap.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQuerySpec/wrap.js

Statements: 16.67% (2 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 202   1                                  
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.connection = {};
 
	c.log = c.requireMock('../table/log');
 
	c.runQuery = c.mock();
	c.connection.query = c.runQuery;
	
	c.sut = require('../wrapQuery')(c.connection);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQuerySpec/wrap/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQuerySpec/wrap/

Statements: 17.65% (3 / 17)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 17.65% (3 / 17)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/mySql/wrapQuerySpec/wrap/
File Statements Branches Functions Lines
run.js 14.29% (2 / 14) 100% (0 / 0) 0% (0 / 1) 14.29% (2 / 14)
whenRun.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQuerySpec/wrap/run.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQuerySpec/wrap/run.js

Statements: 14.29% (2 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 14.29% (2 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211                                     1  
function act(c){
	c.onCompleted = c.mock();
	c.parameters = {};
	c.query = {};
	c.sql = {};
	c.query.parameters = c.parameters;
 
	c.query.sql = c.mock();
	c.query.sql.expect().return(c.sql);
 
	c.log.expect(c.sql);
	c.log.expect('parameters: ' + c.parameters);
 
	c.connection.query = 'other';
	c.runQuery.expect(c.sql, c.parameters).expect(c.onCompleted).return(c.expected);
 
	c.sut(c.query, c.onCompleted);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQuerySpec/wrap/whenRun.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQuerySpec/wrap/whenRun.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 102                  
var when = require('a').when;
var c = {};
 
when(c)
	.it('should log query').assertDoesNotThrow(c.log.verify)
	.it('should execute query').assertDoesNotThrow(c.runQuery.verify)
	.it('should return object').assertEqual(c.expected, c.returned)
	
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQueryStreamSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQueryStreamSpec/

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/mySql/wrapQueryStreamSpec/
File Statements Branches Functions Lines
wrap.js 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQueryStreamSpec/wrap.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQueryStreamSpec/wrap.js

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 172   1                            
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.connection = {};
	c.executeQuery = c.mock();
	c.connection.executeQuery = c.executeQuery;
	
	c.sut = require('../wrapQueryStream')(c.connection);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQueryStreamSpec/wrap/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQueryStreamSpec/wrap/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/mySql/wrapQueryStreamSpec/wrap/
File Statements Branches Functions Lines
whenRun.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQueryStreamSpec/wrap/whenRun.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/mySql/wrapQueryStreamSpec/wrap/whenRun.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should execute query and return value').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/newCollectionSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should set length').assertEqual(2, c.sut.length)
	
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/

Statements: 43.75% (7 / 16)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 43.75% (7 / 16)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/
File Statements Branches Functions Lines
addRange.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
forEach.js 37.5% (3 / 8) 100% (0 / 0) 0% (0 / 1) 37.5% (3 / 8)
whenForEach.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/addRange.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/addRange.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 91   1         1  
var range1 = {};
 
function act(c) {
	c.range1 = range1;
	c.sut.addRange(range1);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/forEach.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/forEach.js

Statements: 37.5% (3 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121   1               1  
var callback;
 
function act(c) {
	callback = c.mock();
	callback.expect(c.element,0);
	callback.expect(c.element2,1);
	c.callback = callback;
	c.sut.forEach(callback);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/whenForEach.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/whenForEach.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('should run callback').assertDoesNotThrow(c.callback.verify);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/addRange/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/addRange/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/addRange/
File Statements Branches Functions Lines
whenForEach.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/addRange/whenForEach.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newCollectionSpec/new/addRange/whenForEach.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('enumerates').assertDoesNotThrow(c.callback.verify);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newIdSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newIdSpec/

Statements: 30% (3 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 30% (3 / 10)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/newIdSpec/
File Statements Branches Functions Lines
req.js 28.57% (2 / 7) 100% (0 / 0) 0% (0 / 1) 28.57% (2 / 7)
whenReq.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/newIdSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newIdSpec/req.js

Statements: 28.57% (2 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 28.57% (2 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 122   1                  
var requireMock = require('a').requireMock;
 
function act(c){
	c.nodeUid = requireMock('uuid');
	c.v4 = {};
	c.nodeUid.v4 = c.v4;
	
	c.returned = require('../newId');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newIdSpec/whenReq.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newIdSpec/whenReq.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return uuid.v4').assertEqual(c.v4, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newImmutableSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newImmutableSpec/new/

Statements: 30% (3 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 30% (3 / 10)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/newImmutableSpec/new/
File Statements Branches Functions Lines
execute.js 28.57% (2 / 7) 100% (0 / 0) 0% (0 / 1) 28.57% (2 / 7)
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/newImmutableSpec/new/execute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newImmutableSpec/new/execute.js

Statements: 28.57% (2 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 28.57% (2 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 101               1  
function act(c){
	c.expected = {};
	c.arg = {};
	c.arg2 = {};
	c.fn.expect(c.arg, c.arg2).return(c.expected);
	c.returned = c.sut(c.arg, c.arg2);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newImmutableSpec/new/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newImmutableSpec/new/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return result from original func').assertEqual(c.expected, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newImmutableSpec/new/execute/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newImmutableSpec/new/execute/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/newImmutableSpec/new/execute/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/newImmutableSpec/new/execute/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newImmutableSpec/new/execute/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return cached result from original func').assertEqual(c.expected, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/newObjectSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newObjectSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/newObjectSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/newObjectSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/newObjectSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return new object').assertEqual('object', typeof c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/

Statements: 40.63% (52 / 128)      Branches: 0% (0 / 8)      Functions: 0% (0 / 20)      Lines: 40.63% (52 / 128)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/
File Statements Branches Functions Lines
deleteFromSql.js 66.67% (4 / 6) 100% (0 / 0) 0% (0 / 1) 66.67% (4 / 6)
encodeBoolean.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
encodeDate.js 40% (2 / 5) 0% (0 / 2) 0% (0 / 1) 40% (2 / 5)
newDatabase.js 40.74% (11 / 27) 100% (0 / 0) 0% (0 / 5) 40.74% (11 / 27)
newPool.js 46.67% (7 / 15) 100% (0 / 0) 0% (0 / 1) 46.67% (7 / 15)
newStreamableQuery.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
newTransaction.js 34.62% (9 / 26) 0% (0 / 2) 0% (0 / 3) 34.62% (9 / 26)
replaceParamChar.js 18.18% (2 / 11) 0% (0 / 2) 0% (0 / 1) 18.18% (2 / 11)
selectForUpdateSql.js 50% (1 / 2) 100% (0 / 0) 0% (0 / 1) 50% (1 / 2)
wrapQuery.js 37.5% (6 / 16) 0% (0 / 2) 0% (0 / 3) 37.5% (6 / 16)
wrapQueryStream.js 42.86% (6 / 14) 100% (0 / 0) 0% (0 / 2) 42.86% (6 / 14)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/deleteFromSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/deleteFromSql.js

Statements: 66.67% (4 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 91 1   1       1  
var format = 'delete from %s %s%s';
var util = require('util');
 
function deleteFromSql(table, alias, whereSql) {
    var name = table._dbName;
    return util.format(format, name, alias, whereSql);
}
module.exports = deleteFromSql;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeBoolean.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeBoolean.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 61       1  
function encodeBoolean(bool) {
	return bool.toString();
}
 
module.exports = encodeBoolean;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeDate.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeDate.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 81           1  
function encodeDate (date) {
	if (date.toISOString)
		return  "'" + date.toISOString() + "'";
	return "'" + date + "'";
}
 
module.exports = encodeDate;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newDatabase.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newDatabase.js

Statements: 40.74% (11 / 27)      Branches: 100% (0 / 0)      Functions: 0% (0 / 5)      Lines: 40.74% (11 / 27)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 421 1 1 1 1 1 1 1   1                 1                                           1  
var createDomain = require('../createDomain');
var newTransaction = require('./newTransaction');
var promise = require('../table/promise');
var begin = require('../table/begin');
var commit = require('../table/commit');
var rollback = require('../table/rollback');
var newPool = require('./newPool');
var lock = require('../lock');
 
function newDatabase(connectionString, poolOptions) {
    var pool = newPool(connectionString, poolOptions);
    var c = {};
 
    c.transaction = function() {
        var domain = createDomain();
 
        return domain.run(onRun);
 
        function onRun() {
            var transaction = newTransaction(domain, pool);
            var p = promise(transaction).then(begin);
            return p;
        }
    };
 
    c.rollback = rollback;
    c.commit = commit;
    c.lock = lock;
 
    c.end = function() {
        return pool.end();
    };
 
    c.accept = function(caller) {
        caller.visitPg();
    };
 
    return c;
}
 
module.exports = newDatabase;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newPool.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newPool.js

Statements: 46.67% (7 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 46.67% (7 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201 1 1 1 1   1                       1  
var pools = require('../pools');
var promise = require('../table/promise');
var end = require('./pool/end');
var newPgPool = require('./pool/newPgPool');
var newId = require('../newId');
 
function newPool(connectionString, poolOptions) {
	var pool = newPgPool(connectionString, poolOptions);
	var id = newId();
	var boundEnd = end.bind(null, pool, id);
	var c = {};
 
	c.connect = pool.connect;
	c.end = promise.denodeify(boundEnd);
	pools[id] = c;
	return c;
}
 
module.exports = newPool;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newStreamableQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newStreamableQuery.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 61   1      
var QueryStream = require('pg-query-stream');
 
module.exports = function (sql, params) {
	return new QueryStream(sql, params);
}
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newTransaction.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newTransaction.js

Statements: 34.62% (9 / 26)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 34.62% (9 / 26)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351 1 1 1 1 1   1         1                                         1  
var wrapQuery = require('./wrapQuery');
var wrapQueryStream = require('./wrapQueryStream');
var encodeDate = require('./encodeDate');
var encodeBoolean = require('./encodeBoolean');
var deleteFromSql = require('./deleteFromSql');
var selectForUpdateSql = require('./selectForUpdateSql');
 
function newResolveTransaction(domain, pool) {
 
    return function(onSuccess, onError) {
        pool.connect(onConnected);
 
        function onConnected(err, client, done) {
            if (err) {
                onError(err);
                return;
            }
            var rdb = {};
            client.executeQuery = wrapQuery(client);            
            client.streamQuery = wrapQueryStream(client);            
            rdb.dbClient = client;
            rdb.dbClientDone = done;
            rdb.encodeBoolean = encodeBoolean;
            rdb.encodeDate = encodeDate;
            rdb.deleteFromSql = deleteFromSql;
            rdb.selectForUpdateSql = selectForUpdateSql;
            rdb.multipleStatements = true;
            domain.rdb = rdb;    
            onSuccess();
        }
    };
}
 
module.exports = newResolveTransaction;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamChar.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamChar.js

Statements: 18.18% (2 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161                         1    
function replaceParamChar(query, params) {
    if (params.length === 0)
        return query.sql();
    var splitted = query.sql().split('?');
    var sql = '';
    var lastIndex = splitted.length - 1;
    for (var i = 0; i < lastIndex; i++) {
        sql += splitted[i] + '$' + (i + 1);
    }
    sql += splitted[lastIndex];
    return sql;
}
 
module.exports = replaceParamChar;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/selectForUpdateSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/selectForUpdateSql.js

Statements: 50% (1 / 2)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (1 / 2)      Ignored: none     

1 2 3 41      
module.exports = function(alias) {
	return ' FOR UPDATE OF ' + alias;
}
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQuery.js

Statements: 37.5% (6 / 16)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 37.5% (6 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 271 1   1       1               1                   1  
var log = require('../table/log');
var replaceParamChar = require('./replaceParamChar');
 
function wrapQuery(connection) {
	var runOriginalQuery = connection.query;
	return runQuery;
 
	function runQuery(query, onCompleted) {
		var params = query.parameters;
		var sql = replaceParamChar(query, params);
		log(sql);
		log('parameters: ' + params);
 
		runOriginalQuery.call(connection, sql, params, onInnerCompleted);
 
		function onInnerCompleted(err, result) {
			if (err) 
				onCompleted(err);
			else
				onCompleted(null, result.rows);
		}
	}
 
}
 
module.exports = wrapQuery;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQueryStream.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQueryStream.js

Statements: 42.86% (6 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 42.86% (6 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221 1 1   1       1                       1  
var log = require('../table/log');
var replaceParamChar = require('./replaceParamChar');
var newStreamableQuery = require('./newStreamableQuery');
 
function wrapQueryStream(connection) {
	var runOriginalQuery = connection.query;
	return runQuery;
 
	function runQuery(query, options) {
		var params = query.parameters;
		var sql = replaceParamChar(query, params);
		log(sql);
		log('parameters: ' + params);
		query = newStreamableQuery(sql, params, options);
 
		return runOriginalQuery.call(connection, query);
	}
 
}
 
module.exports = wrapQueryStream;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeBooleanSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeBooleanSpec/

Statements: 27.27% (3 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 27.27% (3 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/encodeBooleanSpec/
File Statements Branches Functions Lines
encode.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
whenEncode.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeBooleanSpec/encode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeBooleanSpec/encode.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 142   1                      
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
 
	c.sut = require('../encodeBoolean');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeBooleanSpec/whenEncode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeBooleanSpec/whenEncode.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should encode true').assertEqual('true', c.sut(true))
	.it('should encode false').assertEqual('false', c.sut(false))
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeDateSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeDateSpec/

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/encodeDateSpec/
File Statements Branches Functions Lines
req.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeDateSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeDateSpec/req.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 142   1                      
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
 
	c.sut = require('../encodeDate');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeDateSpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeDateSpec/req/

Statements: 33.33% (2 / 6)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (2 / 6)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/encodeDateSpec/req/
File Statements Branches Functions Lines
whenEncode.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenEncodeString.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeDateSpec/req/whenEncode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeDateSpec/req/whenEncode.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return ISO').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeDateSpec/req/whenEncodeString.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/encodeDateSpec/req/whenEncodeString.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return ISO').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newDatabaseSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newDatabaseSpec/

Statements: 13.33% (2 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 13.33% (2 / 15)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/newDatabaseSpec/
File Statements Branches Functions Lines
req.js 13.33% (2 / 15) 100% (0 / 0) 0% (0 / 1) 13.33% (2 / 15)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newDatabaseSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newDatabaseSpec/req.js

Statements: 13.33% (2 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 13.33% (2 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 202   1                                  
var a = require('a');
 
function act(c){
	c.mock = a.mock;	
	c.requireMock = a.requireMock;
	c.createDomain = c.requireMock('../createDomain');
	c.newTransaction = c.requireMock('./newTransaction');
	c.newPromise = c.requireMock('../table/promise');
	c.begin = c.requireMock('../table/begin');
	c.rollback = c.requireMock('../table/rollback');
	c.commit = c.requireMock('../table/commit');
	c.negotiateConnectionString = c.requireMock('./negotiateConnectionString');
	c.newPool = c.requireMock('./newPool');
	c.lock = c.requireMock('../lock');	
 
	c.newSut = require('../newDatabase');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newDatabaseSpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newDatabaseSpec/req/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/newDatabaseSpec/req/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newDatabaseSpec/req/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newDatabaseSpec/req/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
	.it('should set commit on transaction').assertEqual(c.commit, c.sut.commit)
	.it('should set rollback on transaction').assertEqual(c.rollback, c.sut.rollback)
	.it('should set lock on transaction').assertEqual(c.lock, c.sut.lock)
	
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newPoolSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newPoolSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/newPoolSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newPoolSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newPoolSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
	.it('should set end').assertEqual(c.denodeifiedEndPool, c.sut.end)
	.it('should set connect').assertEqual(c.pgPool.connect, c.sut.connect)
	.it('should add pool to pools').assertDeepEqual(c.pools[c.id], c.sut)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newTransactionSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newTransactionSpec/new/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/newTransactionSpec/new/
File Statements Branches Functions Lines
whenRunDomain.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newTransactionSpec/new/whenRunDomain.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/newTransactionSpec/new/whenRunDomain.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('should connect').assertDoesNotThrow(c.pool.connect.verify)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/pool/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/pool/

Statements: 22% (11 / 50)      Branches: 6.9% (2 / 29)      Functions: 0% (0 / 12)      Lines: 22.92% (11 / 48)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/pool/
File Statements Branches Functions Lines
defaults.js 100% (1 / 1) 50% (2 / 4) 100% (0 / 0) 100% (1 / 1)
end.js 50% (4 / 8) 100% (0 / 0) 0% (0 / 2) 50% (4 / 8)
newPgPool.js 14.63% (6 / 41) 0% (0 / 25) 0% (0 / 10) 15.38% (6 / 39)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/pool/defaults.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/pool/defaults.js

Statements: 100% (1 / 1)      Branches: 50% (2 / 4)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 461                                                                                          
var defaults = module.exports = {
  // database host defaults to localhost
  host: 'localhost',
 
  //database user's name
  user: process.platform === 'win32' ? process.env.USERNAME : process.env.USER,
 
  //name of database to connect
  database: process.platform === 'win32' ? process.env.USERNAME : process.env.USER,
 
  //database user's password
  password: null,
 
  //database port
  port: 5432,
 
  //number of rows to return at a time from a prepared statement's
  //portal. 0 will return all rows at once
  rows: 0,
 
  // binary result mode
  binary: false,
 
  //Connection pool options - see https://github.com/coopernurse/node-pool
  //number of connections to use in connection pool
  //0 will disable connection pooling
  poolSize: 10,
 
  //max milliseconds a client can go unused before it is removed
  //from the pool and destroyed
  poolIdleTimeout: 30000,
 
  //frequeny to check for idle clients within the client pool
  reapIntervalMillis: 1000,
 
  //pool log function / boolean
  poolLog: false,
 
  client_encoding: "",
 
  ssl: false,
 
  application_name : undefined,
  fallback_application_name: undefined
};
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/pool/end.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/pool/end.js

Statements: 50% (4 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 50% (4 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151   1     1             1    
var pools = require('../../pools');
 
function endPool(pgPool, id, done) {	
    pgPool.drain(onDrained);
 
    function onDrained() {
        pgPool.destroyAllNow();
        delete pools[id];
        done();
    }
}
 
module.exports = endPool;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/pool/newPgPool.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/pool/newPgPool.js

Statements: 14.63% (6 / 41)      Branches: 0% (0 / 25)      Functions: 0% (0 / 10)      Lines: 15.38% (6 / 39)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81  1   1 1 1   1                                                                                                                                             1    
//slightly modified code from github.com/brianc/node-postgres
var EventEmitter = require('events').EventEmitter;
 
var defaults = require('./defaults');
var genericPool = require('generic-pool');
var pg = require('pg');
 
function newPgPool(connectionString, poolOptions) {
    poolOptions = poolOptions || {};
    var pool = genericPool.Pool({
      max: poolOptions.size || poolOptions.poolSize || defaults.poolSize,
      idleTimeoutMillis: poolOptions.idleTimeout || defaults.poolIdleTimeout,
      reapIntervalMillis: poolOptions.reapIntervalMillis || defaults.reapIntervalMillis,
      log: poolOptions.log || defaults.poolLog,
      create: function(cb) {
        var client = new pg.Client(connectionString);
        client.connect(function(err) {
          if(err) return cb(err, null);
 
          //handle connected client background errors by emitting event
          //via the pg object and then removing errored client from the pool
          client.on('error', function(e) {
            pool.emit('error', e, client);
 
            // If the client is already being destroyed, the error
            // occurred during stream ending. Do not attempt to destroy
            // the client again.
            if (!client._destroying) {
              pool.destroy(client);
            }
          });
 
          // Remove connection from pool on disconnect
          client.on('end', function(e) {
            // Do not enter infinite loop between pool.destroy
            // and client 'end' event...
            if ( ! client._destroying ) {
              pool.destroy(client);
            }
          });
          client.poolCount = 0;
          return cb(null, client);
        });
      },
      destroy: function(client) {
        client._destroying = true;
        client.poolCount = undefined;
        client.end();
      }
    });
    //mixin EventEmitter to pool
    EventEmitter.call(pool);
    for(var key in EventEmitter.prototype) {
      if(EventEmitter.prototype.hasOwnProperty(key)) {
        pool[key] = EventEmitter.prototype[key];
      }
    }
    //monkey-patch with connect method
    pool.connect = function(cb) {
      var domain = process.domain;
      pool.acquire(function(err, client) {
        if(domain) {
          cb = domain.bind(cb);
        }
        if(err)  return cb(err, null, function() {/*NOOP*/});
        client.poolCount++;
        cb(null, client, function(err) {
          if(err) {
            pool.destroy(client);
          } else {
            pool.release(client);
          }
        });
      });
    };
    return pool;
}
 
module.exports = newPgPool;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/pool/endSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/pool/endSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/pool/endSpec/
File Statements Branches Functions Lines
whenEnd.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/pool/endSpec/whenEnd.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/pool/endSpec/whenEnd.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should start drain').assertDoesNotThrow(c.pgPool.drain.verify)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/
File Statements Branches Functions Lines
req.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/req.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 162   1                          
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.query = {};
	c.query.sql = c.mock();
 
	c.sut = require('../replaceParamChar');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/hasParams/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/hasParams/

Statements: 33.33% (3 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 33.33% (3 / 9)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/hasParams/
File Statements Branches Functions Lines
replace.js 33.33% (2 / 6) 100% (0 / 0) 0% (0 / 1) 33.33% (2 / 6)
whenReplace.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/hasParams/replace.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/hasParams/replace.js

Statements: 33.33% (2 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 33.33% (2 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111                 1  
function act(c) {
	c.initialSql = 'SELECT ID FROM ORDER WHERE ID=? AND NAME LIKE ? AND ADDRESS LIKE ? bla bla';
	c.sql = 'SELECT ID FROM ORDER WHERE ID=$1 AND NAME LIKE $2 AND ADDRESS LIKE $3 bla bla';
 
    c.query.sql.expect().return(c.initialSql);
 
	c.returned = c.sut(c.query, ['a','b','c']);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/hasParams/whenReplace.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/hasParams/whenReplace.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
.it('should return sql with numbered dollars').assertEqual(c.sql, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/noParams/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/noParams/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/noParams/
File Statements Branches Functions Lines
whenReplace.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/noParams/whenReplace.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/replaceParamCharSpec/noParams/whenReplace.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
.it('should return sql').assertEqual(c.sql, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/selectForUpdateSqlSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/selectForUpdateSqlSpec/

Statements: 27.27% (3 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 27.27% (3 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/selectForUpdateSqlSpec/
File Statements Branches Functions Lines
getSql.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
whenGetSql.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/selectForUpdateSqlSpec/getSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/selectForUpdateSqlSpec/getSql.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 132   1                    
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.returned = require('../selectForUpdateSql')('alias');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/selectForUpdateSqlSpec/whenGetSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/selectForUpdateSqlSpec/whenGetSql.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
.it('should return sql').assertEqual(' FOR UPDATE OF alias', c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQuerySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQuerySpec/

Statements: 15.38% (2 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 15.38% (2 / 13)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/wrapQuerySpec/
File Statements Branches Functions Lines
wrap.js 15.38% (2 / 13) 100% (0 / 0) 0% (0 / 1) 15.38% (2 / 13)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQuerySpec/wrap.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQuerySpec/wrap.js

Statements: 15.38% (2 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 15.38% (2 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 212   1                                    
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
 
	c.log = c.requireMock('../table/log');
	
	c.connection = {};
	c.replaceParamChar = c.requireMock('./replaceParamChar');
 
	c.runQuery = c.mock();
	c.connection.query = c.runQuery;
	
	c.sut = require('../wrapQuery')(c.connection);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQuerySpec/wrap/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQuerySpec/wrap/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/wrapQuerySpec/wrap/
File Statements Branches Functions Lines
whenRun.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQuerySpec/wrap/whenRun.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQuerySpec/wrap/whenRun.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should log query').assertDoesNotThrow(c.log.verify)
	.it('should execute query').assertDoesNotThrow(c.runQuery.verify)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQueryStreamSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQueryStreamSpec/

Statements: 14.29% (2 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 14.29% (2 / 14)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/wrapQueryStreamSpec/
File Statements Branches Functions Lines
wrap.js 14.29% (2 / 14) 100% (0 / 0) 0% (0 / 1) 14.29% (2 / 14)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQueryStreamSpec/wrap.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQueryStreamSpec/wrap.js

Statements: 14.29% (2 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 14.29% (2 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 232   1                                        
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
 
	c.log = c.requireMock('../table/log');
	
	c.connection = {};
	c.replaceParamChar = c.requireMock('./replaceParamChar');
 
	c.newQueryStreamCore = c.requireMock('./newStreamableQuery');	
 
	c.runQuery = c.mock();
	c.connection.query = c.runQuery;
	
	c.sut = require('../wrapQueryStream')(c.connection);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQueryStreamSpec/wrap/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQueryStreamSpec/wrap/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/pg/wrapQueryStreamSpec/wrap/
File Statements Branches Functions Lines
whenRun.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQueryStreamSpec/wrap/whenRun.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/pg/wrapQueryStreamSpec/wrap/whenRun.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 102                  
var when = require('a').when;
var c = {};
 
when(c)
	.it('should log query').assertDoesNotThrow(c.log.verify)
	.it('should execute query').assertDoesNotThrow(c.runQuery.verify)
	.it('should return stream').assertEqual(c.stream, c.returned)
	
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/poolsSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/poolsSpec/

Statements: 20% (3 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (3 / 15)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/poolsSpec/
File Statements Branches Functions Lines
req.js 16.67% (2 / 12) 100% (0 / 0) 0% (0 / 1) 16.67% (2 / 12)
whenReq.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/poolsSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/poolsSpec/req.js

Statements: 16.67% (2 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 202   1                                  
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
 
 
	c.promise = c.requireMock('./table/promise');
	c.newObject = c.requireMock('./newObject');
	
	c.pools = {};
	c.newObject.expect().return(c.pools);
 
	c.sut = require('../pools');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/poolsSpec/whenReq.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/poolsSpec/whenReq.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return emtpy object singleton').assertEqual(c.pools, c.sut)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/poolsSpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/poolsSpec/req/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/poolsSpec/req/
File Statements Branches Functions Lines
whenEnd.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/poolsSpec/req/whenEnd.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/poolsSpec/req/whenEnd.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should end all pools').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/

Statements: 30.77% (8 / 26)      Branches: 0% (0 / 10)      Functions: 0% (0 / 5)      Lines: 33.33% (8 / 24)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/query/
File Statements Branches Functions Lines
negotiateParameters.js 28.57% (2 / 7) 0% (0 / 4) 0% (0 / 1) 28.57% (2 / 7)
negotiateSql.js 16.67% (2 / 12) 0% (0 / 6) 0% (0 / 3) 20% (2 / 10)
wrapQuery.js 57.14% (4 / 7) 100% (0 / 0) 0% (0 / 1) 57.14% (4 / 7)
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParameters.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParameters.js

Statements: 28.57% (2 / 7)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 28.57% (2 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111                 1  
function negotiateParameters(parameters) {
	if(parameters === undefined)
		return [];
	else if(parameters.length !== undefined)
		return parameters;
	else
		throw new Error('Query has invalid parameters property. Must be undefined or array');
}
 
module.exports = negotiateParameters;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateSql.js

Statements: 16.67% (2 / 12)      Branches: 0% (0 / 6)      Functions: 0% (0 / 3)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151                         1  
function negotiateSql(query) {
	if(typeof(query) === 'string')
		return function() { return query; };
 
	var sql = query.sql;
	if(typeof(sql) === 'function')
		return sql;
	else if(typeof(sql) === 'string')
		return function() { return sql; };
	else
		throw new Error('Query lacks sql property string or function');
}
 
module.exports = negotiateSql;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/wrapQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/wrapQuery.js

Statements: 57.14% (4 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141 1   1                 1  
var negotiateSql = require('./negotiateSql');
var negotiateParameters = require('./negotiateParameters');
 
function wrapQuery(query) {
	var safeSql = negotiateSql(query);
	var safeParameters = negotiateParameters(query.parameters);
	return {
		sql: safeSql,
		parameters: safeParameters
	};
}
 
module.exports = wrapQuery;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/
File Statements Branches Functions Lines
req.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/req.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 132   1                    
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
 
	c.sut = require('../negotiateParameters');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/array/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/array/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/array/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/array/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/array/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
.it('should return input').assertEqual(c.parameters, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/nonArray/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/nonArray/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/nonArray/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/nonArray/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/nonArray/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
.it('should throw error with "Query has invalid parameters property. Must be undefined or array"').assertEqual("Query has invalid parameters property. Must be undefined or array", c.thrownMessage)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/undefined/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/undefined/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/undefined/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/undefined/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateParametersSpec/undefined/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
.it('should return empty array').assertEqual(0, c.returned.length)
 
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/
File Statements Branches Functions Lines
req.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/req.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 132   1                    
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
 
	c.sut = require('../negotiateSql');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/object/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/object/

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/object/
File Statements Branches Functions Lines
object.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/object/object.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/object/object.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 71       1 1  
function act(c){
	c.query = {};
}
 
act.base = '../req';
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/string/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/string/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/string/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/string/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/negotiateSqlSpec/string/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
.it('should return sql wrapped in function').assertEqual(c.sql, c.returned())
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/wrapQuerySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/wrapQuerySpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/query/wrapQuerySpec/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/query/wrapQuerySpec/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/query/wrapQuerySpec/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
.it('should return object with sql as function').assertEqual(c.safeSql, c.returned.sql)
.it('should return object with parameters as array').assertEqual(c.safeParameters, c.returned.parameters)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/querySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/querySpec/

Statements: 19.05% (4 / 21)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 19.05% (4 / 21)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/querySpec/
File Statements Branches Functions Lines
execute.js 16.67% (3 / 18) 100% (0 / 0) 0% (0 / 2) 16.67% (3 / 18)
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/querySpec/execute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/querySpec/execute.js

Statements: 16.67% (3 / 18)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 16.67% (3 / 18)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 282         1                               1            
var a = require('a');
var mock = a.mock;
var requireMock = a.requireMock;
var then = a.then;
 
function act(c){
	c.wrapQuery = requireMock('./query/wrapQuery');
	c.executeQueries = requireMock('./table/executeQueries');
	
	c.query = {};
 
	c.wrappedQuery = {};
	c.wrapQuery.expect(c.query).return(c.wrappedQuery);
 
	c.expected = {};
	c.queriesPromise = then();
	c.queriesPromise.resolve([c.expected]);
	c.executeQueries.expect([c.wrappedQuery]).return(c.queriesPromise);
	
	require('../query')(c.query).then(storeResult);
 
	function storeResult(result) {
		c.returned = result;
	}
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/querySpec/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/querySpec/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
.it('should return result of executeQueries').assertEqual(c.expected, c.returned)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/

Statements: 38.98% (46 / 118)      Branches: 0% (0 / 8)      Functions: 0% (0 / 20)      Lines: 38.98% (46 / 118)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/sqlite/
File Statements Branches Functions Lines
deleteFromSql.js 66.67% (4 / 6) 100% (0 / 0) 0% (0 / 1) 66.67% (4 / 6)
encodeBoolean.js 40% (2 / 5) 0% (0 / 2) 0% (0 / 1) 40% (2 / 5)
encodeBuffer.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
encodeDate.js 40% (2 / 5) 0% (0 / 2) 0% (0 / 1) 40% (2 / 5)
newDatabase.js 36% (9 / 25) 100% (0 / 0) 0% (0 / 5) 36% (9 / 25)
newPool.js 33.33% (5 / 15) 100% (0 / 0) 0% (0 / 1) 33.33% (5 / 15)
newStreamableQuery.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
newTransaction.js 34.62% (9 / 26) 0% (0 / 2) 0% (0 / 3) 34.62% (9 / 26)
selectForUpdateSql.js 50% (1 / 2) 100% (0 / 0) 0% (0 / 1) 50% (1 / 2)
wrapQuery.js 33.33% (5 / 15) 0% (0 / 2) 0% (0 / 3) 33.33% (5 / 15)
wrapQueryStream.js 38.46% (5 / 13) 100% (0 / 0) 0% (0 / 2) 38.46% (5 / 13)
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/deleteFromSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/deleteFromSql.js

Statements: 66.67% (4 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 101 1   1       1    
var format = 'delete from %s where %s.rowId in (SELECT %s.rowId FROM %s %s%s)'; 
var util = require('util');
 
function deleteFromSql(table, alias, whereSql) {
    var name = table._dbName;
    return util.format(format, name, name, alias, name, alias, whereSql);
}
module.exports = deleteFromSql;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/encodeBoolean.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/encodeBoolean.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 81           1  
function encodeBoolean(bool) {
	if (bool)
		return 1;
	return 0;
}
 
module.exports = encodeBoolean;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/encodeBuffer.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/encodeBuffer.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 61       1  
function encodeBuffer(buffer) {
	return "E'\\\\x" + buffer.toString('hex') + "'";
}
 
module.exports = encodeBuffer;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/encodeDate.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/encodeDate.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 81           1  
function encodeDate (date) {
	if (date.toISOString)
		return  "'" + date.toISOString() + "'";
	return "'" + date + "'";
}
 
module.exports = encodeDate;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/newDatabase.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/newDatabase.js

Statements: 36% (9 / 25)      Branches: 100% (0 / 0)      Functions: 0% (0 / 5)      Lines: 36% (9 / 25)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 424 4 4 4 4 4 4   1                 1                                                
var createDomain = require('../createDomain');
var newTransaction = require('./newTransaction');
var promise = require('../table/promise');
var begin = require('../table/begin');
var commit = require('../table/commit');
var rollback = require('../table/rollback');
var newPool = require('./newPool');
 
function newDatabase(connectionString, poolOptions) {
    var pool = newPool(connectionString, poolOptions);
    var c = {};
 
    c.transaction = function() {
        var domain = createDomain();
 
        return domain.run(onRun);
 
        function onRun() {
            var transaction = newTransaction(domain, pool);
            var p = promise(transaction).then(begin);
            return p;
        }
    };
 
    c.rollback = rollback;
    c.commit = commit;
 
    c.end = function() {
        return pool.end();
    };
 
    c.accept = function(caller) {
        caller.visitSqlite();
    };
 
 
    return c;
}
 
module.exports = newDatabase;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/newPool.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/newPool.js

Statements: 33.33% (5 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 33.33% (5 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 204 4 4 4     1                          
var pools = require('../pools');
var promise = require('../table/promise');
var end = require('./pool/end');
var newGenericPool = require('./pool/newGenericPool');
var newId = require('../newId');
 
function newPool(connectionString, poolOptions) {
	var pool = newGenericPool(connectionString, poolOptions);
	var id = newId();
	var boundEnd = end.bind(null, pool, id);
	var c = {};
 
	c.connect = pool.connect;
	c.end = promise.denodeify(boundEnd);
	pools[id] = c;
	return c;
}
 
module.exports = newPool;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/newStreamableQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/newStreamableQuery.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 61   1      
var QueryStream = require('pg-query-stream');
 
module.exports = function (sql, params) {
	return new QueryStream(sql, params);
}
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/newTransaction.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/newTransaction.js

Statements: 34.62% (9 / 26)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 34.62% (9 / 26)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351 1 1 1 1 1   1         1                                         1  
var wrapQuery = require('./wrapQuery');
var wrapQueryStream = require('./wrapQueryStream');
var encodeBoolean = require('./encodeBoolean');
var encodeDate = require('./encodeDate');
var deleteFromSql = require('./deleteFromSql');
var selectForUpdateSql = require('./selectForUpdateSql');
 
function newResolveTransaction(domain, pool) {
 
    return function(onSuccess, onError) {
        pool.connect(onConnected);
 
        function onConnected(err, client, done) {
            if (err) {
                onError(err);
                return;
            }
            var rdb = {};
            client.executeQuery = wrapQuery(client);            
            client.streamQuery = wrapQueryStream(client);            
            rdb.dbClient = client;
            rdb.dbClientDone = done;
            rdb.encodeBoolean = encodeBoolean;
            rdb.encodeDate = encodeDate;
            rdb.deleteFromSql = deleteFromSql;
            rdb.selectForUpdateSql = selectForUpdateSql;
            rdb.multipleStatements = false;
            domain.rdb = rdb;    
            onSuccess();
        }
    };
}
 
module.exports = newResolveTransaction;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/selectForUpdateSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/selectForUpdateSql.js

Statements: 50% (1 / 2)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (1 / 2)      Ignored: none     

1 2 3 41      
module.exports = function(alias) {
	return ' FOR UPDATE OF ' + alias;
}
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/wrapQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/wrapQuery.js

Statements: 33.33% (5 / 15)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 33.33% (5 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261   1       1               1                   1  
var log = require('../table/log');
 
function wrapQuery(connection) {
	var runOriginalQuery = connection.all;
	return runQuery;
 
	function runQuery(query, onCompleted) {
		var params = query.parameters;
		var sql = query.sql();
		log(sql);
		log('parameters: ' + params);
 
		runOriginalQuery.call(connection, sql, params, onInnerCompleted);
 
		function onInnerCompleted(err, rows) {
			if (err) 
				onCompleted(err);
			else
				onCompleted(null, rows);
		}
	}
 
}
 
module.exports = wrapQuery;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/wrapQueryStream.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/wrapQueryStream.js

Statements: 38.46% (5 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 38.46% (5 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1   1       1                       1  
var log = require('../table/log');
var newStreamableQuery = require('./newStreamableQuery');
 
function wrapQueryStream(connection) {
	var runOriginalQuery = connection.query;
	return runQuery;
 
	function runQuery(query, options) {
		var params = query.parameters;
		var sql = query.sql();
		log(sql);
		log('parameters: ' + params);
		query = newStreamableQuery(sql, params, options);
 
		return runOriginalQuery.call(connection, query);
	}
 
}
 
module.exports = wrapQueryStream;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/encodeBooleanSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/encodeBooleanSpec/

Statements: 27.27% (3 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 27.27% (3 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/sqlite/encodeBooleanSpec/
File Statements Branches Functions Lines
encode.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
whenEncode.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/encodeBooleanSpec/encode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/encodeBooleanSpec/encode.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 142   1                      
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
 
	c.sut = require('../encodeBoolean');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/encodeBooleanSpec/whenEncode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/encodeBooleanSpec/whenEncode.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should encode true').assertEqual('1', c.sut(true))
	.it('should encode false').assertEqual('0', c.sut(false))
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/pool/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/pool/

Statements: 26.19% (11 / 42)      Branches: 8% (2 / 25)      Functions: 0% (0 / 10)      Lines: 26.83% (11 / 41)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/sqlite/pool/
File Statements Branches Functions Lines
defaults.js 100% (1 / 1) 50% (2 / 4) 100% (0 / 0) 100% (1 / 1)
end.js 50% (4 / 8) 100% (0 / 0) 0% (0 / 2) 50% (4 / 8)
newGenericPool.js 18.18% (6 / 33) 0% (0 / 21) 0% (0 / 8) 18.75% (6 / 32)
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/pool/defaults.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/pool/defaults.js

Statements: 100% (1 / 1)      Branches: 50% (2 / 4)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 461                                                                                          
var defaults = module.exports = {
  // database host defaults to localhost
  host: 'localhost',
 
  //database user's name
  user: process.platform === 'win32' ? process.env.USERNAME : process.env.USER,
 
  //name of database to connect
  database: process.platform === 'win32' ? process.env.USERNAME : process.env.USER,
 
  //database user's password
  password: null,
 
  //database port
  port: 5432,
 
  //number of rows to return at a time from a prepared statement's
  //portal. 0 will return all rows at once
  rows: 0,
 
  // binary result mode
  binary: false,
 
  //Connection pool options - see https://github.com/coopernurse/node-pool
  //number of connections to use in connection pool
  //0 will disable connection pooling
  poolSize: 10,
 
  //max milliseconds a client can go unused before it is removed
  //from the pool and destroyed
  poolIdleTimeout: 30000,
 
  //frequeny to check for idle clients within the client pool
  reapIntervalMillis: 1000,
 
  //pool log function / boolean
  poolLog: false,
 
  client_encoding: "",
 
  ssl: false,
 
  application_name : undefined,
  fallback_application_name: undefined
};
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/pool/end.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/pool/end.js

Statements: 50% (4 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 50% (4 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151   1     1             1    
var pools = require('../../pools');
 
function endPool(genericPool, id, done) {	
    genericPool.drain(onDrained);
 
    function onDrained() {
        genericPool.destroyAllNow();
        delete pools[id];
        done();
    }
}
 
module.exports = endPool;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/pool/newGenericPool.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/pool/newGenericPool.js

Statements: 18.18% (6 / 33)      Branches: 0% (0 / 21)      Functions: 0% (0 / 8)      Lines: 18.75% (6 / 32)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 606   6 6 6   1                   1                                                                                      
var EventEmitter = require('events').EventEmitter;
 
var defaults = require('./defaults');
var genericPool = require('generic-pool');
var sqlite = require('sqlite3');
 
function newGenericPool(connectionString, poolOptions) {
    poolOptions = poolOptions || {};
    var pool = genericPool.Pool({
      max: poolOptions.size || poolOptions.poolSize || defaults.poolSize,
      idleTimeoutMillis: poolOptions.idleTimeout || defaults.poolIdleTimeout,
      reapIntervalMillis: poolOptions.reapIntervalMillis || defaults.reapIntervalMillis,
      log: poolOptions.log || defaults.poolLog,
      create: function(cb) {
        var client = new sqlite.Database(connectionString, onConnected);
 
        function onConnected(err) {
          if(err) 
            return cb(err, null);
          client.poolCount = 0;
          return cb(null, client);
        }
      },
 
      destroy: function(client) {
        client.poolCount = undefined;
        client.close();
      }
    });
    //mixin EventEmitter to pool
    EventEmitter.call(pool);
    for(var key in EventEmitter.prototype) {
      if(EventEmitter.prototype.hasOwnProperty(key)) {
        pool[key] = EventEmitter.prototype[key];
      }
    }
    //monkey-patch with connect method
    pool.connect = function(cb) {
      var domain = process.domain;
      pool.acquire(function(err, client) {
        if(domain) {
          cb = domain.bind(cb);
        }
        if(err)  return cb(err, null, function() {/*NOOP*/});
        client.poolCount++;
        cb(null, client, function(err) {
          if(err) {
            pool.destroy(client);
          } else {
            pool.release(client);
          }
        });
      });
    };
    return pool;
}
 
module.exports = newGenericPool;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/pool/endSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/pool/endSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/sqlite/pool/endSpec/
File Statements Branches Functions Lines
whenEnd.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/pool/endSpec/whenEnd.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/sqlite/pool/endSpec/whenEnd.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should start drain').assertDoesNotThrow(c.pgPool.drain.verify)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/

Statements: 32% (329 / 1028)      Branches: 0.82% (1 / 122)      Functions: 1.03% (2 / 194)      Lines: 32% (329 / 1028)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/
File Statements Branches Functions Lines
begin.js 71.43% (5 / 7) 100% (0 / 0) 0% (0 / 1) 71.43% (5 / 7)
cascadeDelete.js 62.5% (5 / 8) 100% (0 / 0) 0% (0 / 1) 62.5% (5 / 8)
cloneStrategy.js 25% (3 / 12) 0% (0 / 6) 0% (0 / 2) 25% (3 / 12)
column.js 5% (2 / 40) 100% (0 / 0) 0% (0 / 12) 5% (2 / 40)
commit.js 70% (7 / 10) 100% (0 / 0) 0% (0 / 1) 70% (7 / 10)
createJSONReadStream.js 30.77% (4 / 13) 100% (0 / 0) 0% (0 / 3) 30.77% (4 / 13)
createJSONReadStreamDefault.js 22.73% (5 / 22) 0% (0 / 2) 0% (0 / 4) 22.73% (5 / 22)
createJSONReadStreamNative.js 23.53% (4 / 17) 0% (0 / 2) 0% (0 / 3) 23.53% (4 / 17)
createReadStream.js 30.77% (4 / 13) 100% (0 / 0) 0% (0 / 3) 30.77% (4 / 13)
createReadStreamCoreNative.js 39.29% (11 / 28) 0% (0 / 2) 0% (0 / 4) 39.29% (11 / 28)
createReadStreamDefault.js 22.67% (17 / 75) 0% (0 / 30) 0% (0 / 11) 22.67% (17 / 75)
createReadStreamNative.js 36.36% (4 / 11) 100% (0 / 0) 0% (0 / 2) 36.36% (4 / 11)
delete.js 46.67% (7 / 15) 100% (0 / 0) 0% (0 / 2) 46.67% (7 / 15)
deleteSessionContext.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
encodeDbSpecific.js 42.86% (3 / 7) 0% (0 / 2) 0% (0 / 1) 42.86% (3 / 7)
executeQueries.js 47.06% (8 / 17) 0% (0 / 6) 0% (0 / 2) 47.06% (8 / 17)
extractDeleteStrategy.js 50% (3 / 6) 0% (0 / 2) 0% (0 / 1) 50% (3 / 6)
getById.js 60% (6 / 10) 0% (0 / 2) 0% (0 / 1) 60% (6 / 10)
getFirstFromDb.js 42.86% (3 / 7) 0% (0 / 2) 0% (0 / 1) 42.86% (3 / 7)
getFromDbById.js 42.86% (6 / 14) 0% (0 / 4) 0% (0 / 4) 42.86% (6 / 14)
getMany.js 55% (11 / 20) 100% (0 / 0) 0% (0 / 4) 55% (11 / 20)
getRelativesCore.js 39.13% (9 / 23) 0% (0 / 2) 0% (0 / 3) 39.13% (9 / 23)
getSessionContext.js 50% (1 / 2) 100% (0 / 0) 0% (0 / 1) 50% (1 / 2)
getSessionSingleton.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
hasMany.js 28.57% (4 / 14) 100% (0 / 0) 0% (0 / 3) 28.57% (4 / 14)
hasOne.js 28.57% (4 / 14) 100% (0 / 0) 0% (0 / 3) 28.57% (4 / 14)
insert.js 45.45% (5 / 11) 100% (0 / 0) 0% (0 / 1) 45.45% (5 / 11)
isDirty.js 100% (2 / 2) 100% (0 / 0) 100% (0 / 0) 100% (2 / 2)
join.js 20% (5 / 25) 0% (0 / 2) 0% (0 / 5) 20% (5 / 25)
log.js 66.67% (4 / 6) 100% (0 / 0) 0% (0 / 3) 66.67% (4 / 6)
negotiateAddStrategy.js 23.08% (3 / 13) 0% (0 / 2) 0% (0 / 2) 23.08% (3 / 13)
negotiateExpandInverse.js 25% (2 / 8) 0% (0 / 4) 0% (0 / 1) 25% (2 / 8)
newCache.js 11.11% (7 / 63) 0% (0 / 16) 0% (0 / 9) 11.11% (7 / 63)
newCascadeDeleteStrategy.js 25% (5 / 20) 100% (0 / 0) 0% (0 / 4) 25% (5 / 20)
newDomainCache.js 18.52% (5 / 27) 100% (0 / 0) 0% (0 / 8) 18.52% (5 / 27)
newGetRelated.js 40% (6 / 15) 0% (0 / 4) 0% (0 / 4) 40% (6 / 15)
newJoinRelation.js 13.46% (7 / 52) 0% (0 / 10) 0% (0 / 13) 13.46% (7 / 52)
newManyRelation.js 26.67% (8 / 30) 100% (0 / 0) 0% (0 / 8) 26.67% (8 / 30)
newOneRelation.js 26.67% (8 / 30) 100% (0 / 0) 0% (0 / 8) 26.67% (8 / 30)
newPrimaryKeyFilter.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
newQuery.js 50% (8 / 16) 100% (0 / 0) 0% (0 / 1) 50% (8 / 16)
newRelatedTable.js 28.57% (8 / 28) 100% (0 / 0) 0% (0 / 6) 28.57% (8 / 28)
newRowCache.js 15.79% (6 / 38) 100% (0 / 0) 0% (0 / 7) 15.79% (6 / 38)
newThrow.js 57.14% (4 / 7) 100% (0 / 0) 0% (0 / 2) 57.14% (4 / 7)
notifyDirty.js 100% (2 / 2) 100% (0 / 0) 100% (0 / 0) 100% (2 / 2)
nullPromise.js 100% (1 / 1) 100% (0 / 0) 100% (0 / 0) 100% (1 / 1)
objectToCallback.js 50% (2 / 4) 100% (0 / 0) 0% (0 / 2) 50% (2 / 4)
popChanges.js 28.57% (4 / 14) 0% (0 / 4) 0% (0 / 1) 28.57% (4 / 14)
promise.js 90% (9 / 10) 50% (1 / 2) 100% (1 / 1) 90% (9 / 10)
releaseDbClient.js 50% (4 / 8) 0% (0 / 2) 0% (0 / 1) 50% (4 / 8)
resultToPromise.js 100% (4 / 4) 100% (0 / 0) 100% (1 / 1) 100% (4 / 4)
resultToRows.js 53.33% (8 / 15) 100% (0 / 0) 0% (0 / 4) 53.33% (8 / 15)
rollback.js 61.54% (8 / 13) 0% (0 / 2) 0% (0 / 1) 61.54% (8 / 13)
rowArray.js 37.93% (11 / 29) 0% (0 / 2) 0% (0 / 6) 37.93% (11 / 29)
setSessionSingleton.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
strategyToSpan.js 21.74% (5 / 23) 0% (0 / 4) 0% (0 / 3) 21.74% (5 / 23)
streamEager.js 13.79% (4 / 29) 100% (0 / 0) 0% (0 / 4) 13.79% (4 / 29)
tryGetById.js 60% (6 / 10) 0% (0 / 2) 0% (0 / 1) 60% (6 / 10)
tryGetFirstFromDb.js 46.67% (7 / 15) 0% (0 / 2) 0% (0 / 4) 46.67% (7 / 15)
tryGetFromCacheById.js 37.5% (3 / 8) 100% (0 / 0) 0% (0 / 2) 37.5% (3 / 8)
tryGetFromDbById.js 42.86% (6 / 14) 100% (0 / 0) 0% (0 / 2) 42.86% (6 / 14)
tryReleaseDbClient.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
updateField.js 55.56% (5 / 9) 0% (0 / 2) 0% (0 / 1) 55.56% (5 / 9)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/begin.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/begin.js

Statements: 71.43% (5 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 71.43% (5 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111 1 1   1         1  
var beginCommand = require('./commands/beginCommand');
var executeQuery = require('./executeQueries/executeQuery');
var setSessionSingleton = require('./setSessionSingleton');
 
function begin() {
	setSessionSingleton('changes', []);
	return executeQuery(beginCommand);
}
 
module.exports = begin;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/cascadeDelete.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/cascadeDelete.js

Statements: 62.5% (5 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121 1 1   1           1  
var _delete = require('./delete');
var newObject = require('../newObject');
var newCascadeDeleteStrategy = require('./newCascadeDeleteStrategy');
 
function cascadeDelete(table, filter) {
	var empty = newObject();
	var strategy = newCascadeDeleteStrategy(empty, table);
	return _delete(table, filter, strategy);	
}
 
module.exports = cascadeDelete;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/cloneStrategy.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/cloneStrategy.js

Statements: 25% (3 / 12)      Branches: 0% (0 / 6)      Functions: 0% (0 / 2)      Lines: 25% (3 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191               1                 1  
function cloneStrategy(strategy, target) {
	target = target || {};
    for (var name in strategy) {
        target[name] = mapChild(strategy[name]);            
    }
    return target;
}
 
function mapChild(strategy) {
	if (strategy instanceof Array)
		return cloneStrategy(strategy, []);
	if (strategy instanceof Object) {
		return cloneStrategy(strategy, {});
	}
	return strategy;
}
 
module.exports = cloneStrategy;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column.js

Statements: 5% (2 / 40)      Branches: 100% (0 / 0)      Functions: 0% (0 / 12)      Lines: 5% (2 / 40)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 661                                                                                                                               1  
function defineColumn(column, table) {	
	var c = {};
 
	c.string = function() {
		require('./column/string')(table, column);
		return c;
	};
 
	c.json = function() {
		require('./column/json')(column);
		return c;
	};
 
	c.guid = function() {
		require('./column/guid')(column);
		return c;
	};
 
	c.date = function() {
		require('./column/date')(column);
		return c;
	};
 
	c.numeric = function(optionalPrecision,optionalScale) {
		require('./column/numeric')(column,optionalPrecision,optionalScale);
		return c;
	};
 
	c.boolean = function() {
		require('./column/boolean')(column);
		return c;
	};
 
	c.binary = function() {
		require('./column/binary')(column);
		return c;
	};
 
	c.default = function(value) {
		column.default = value;
		return c;
	};
 
	c.as = function(alias) {
		var oldAlias = column.alias;
		delete table[oldAlias];
		table[alias] = column;
		column.alias = alias;
		return c;
	};
 
	c.dbNull = function(value) {
		column.dbNull = value;
		return c;
	};
 
	c.serializable = function(value) {
		column.serializable = value;
		return c;		
	};
 
	return c;
}
 
module.exports = defineColumn;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commit.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commit.js

Statements: 70% (7 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 70% (7 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141 1 1 1 1   1           1  
var commitCommand = require('./commands/commitCommand');
var pushCommand = require('./commands/pushCommand');
var executeChanges = require('./executeQueries/executeChanges');
var releaseDbClient = require('./releaseDbClient');
var popChanges = require('./popChanges');
 
function commit() {
	pushCommand(commitCommand);
	var changes = popChanges();
	return executeChanges(changes).then(releaseDbClient);
}
 
module.exports = commit;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStream.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStream.js

Statements: 30.77% (4 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 30.77% (4 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251 1   1                                     1    
var createJSONReadStreamNative = require('./createJSONReadStreamNative');
var createJSONReadStreamDefault = require('./createJSONReadStreamDefault');
 
function createJSONReadStream(table, db, filter, strategy, streamOptions) {
    var create;
    var c = {};
 
    c.visitPg = function() {
        create = createJSONReadStreamNative;
    };
 
    c.visitMySql = c.visitPg;
 
    c.visitSqlite = function() {
        create = createJSONReadStreamDefault;
    };
 
    db.accept(c);
 
    return create(table, db, filter, strategy, streamOptions);
}
 
module.exports = createJSONReadStream;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamDefault.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamDefault.js

Statements: 22.73% (5 / 22)      Branches: 0% (0 / 2)      Functions: 0% (0 / 4)      Lines: 22.73% (5 / 22)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/ » createJSONReadStreamDefault.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351 1   1                                               1         1    
var createReadStreamCore = require('./createReadStreamDefault');
var Stream = require('stream');
 
function createJSONReadStream(table, db, filter, strategy, streamOptions) {
    var transformer = Stream.Transform({ objectMode: true });
    var started;
    transformer._transform = function(obj, enc, cb) {
        var data = JSON.stringify(obj);
        if (started)
            transformer.push(',' + data);
        else {
            transformer.push('[');
            transformer.push(data);
            started = true;
        }
        cb();
    };
 
    transformer._flush = function(cb) {
        transformer.push(']');
        cb();
    };
 
    var objectStream = createReadStreamCore(table, db, filter, strategy, streamOptions);
    objectStream.on('error', onError);
    return objectStream.pipe(transformer)
 
    function onError(e) {
        transformer.emit('error', e);
    }
}
 
module.exports = createJSONReadStream;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNative.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNative.js

Statements: 23.53% (4 / 17)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 23.53% (4 / 17)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/ » createJSONReadStreamNative.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291 1   1                                             1    
var createReadStreamCore = require('./createReadStreamCoreNative');
var Stream = require('stream');
 
function createJSONReadStream(table, db, filter, strategy, streamOptions) {
    var transformer = Stream.Transform({ objectMode: true });
    var started;
    transformer._transform = function(chunk, enc, cb) {
    	if (started)
        	transformer.push(',' + chunk.result);
        else {
        	transformer.push('[');
        	transformer.push(chunk.result);
        	started = true;
        } 
        cb();
    };
 
    transformer._flush = function(cb)
    {
    	transformer.push(']');
    	cb();
    };
 
    return createReadStreamCore(table, db, filter, strategy, transformer, streamOptions);
}
 
module.exports = createJSONReadStream;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStream.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStream.js

Statements: 30.77% (4 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 30.77% (4 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241 1   1                                     1  
var createReadStreamNative = require('./createReadStreamNative');
var createReadStreamDefault = require('./createReadStreamDefault');
 
function createReadStream(table, db, filter, strategy, streamOptions) {
	var create;
	var c = {};
 
	c.visitPg = function() {
		create =  createReadStreamNative;
	};
	
	c.visitMySql = c.visitPg;
 
	c.visitSqlite = function() {
		create =  createReadStreamDefault;
	}
 
	db.accept(c);
 
	return create(table, db, filter, strategy, streamOptions);
}
 
module.exports = createReadStream;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamCoreNative.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamCoreNative.js

Statements: 39.29% (11 / 28)      Branches: 0% (0 / 2)      Functions: 0% (0 / 4)      Lines: 39.29% (11 / 28)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/ » createReadStreamCoreNative.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 451 1 1 1 1 1   1                             1                 1       1               1  
var newQuery = require('./readStream/newQuery');
var strategyToSpan = require('./strategyToSpan');
var negotiateRawSqlFilter = require('./column/negotiateRawSqlFilter');
var newQueryStream = require('./readStream/newQueryStream');
var deferred = require('deferred');
var domain = require('domain');
 
function createReadStreamCoreNative(table, db, filter, strategy, transformer, streamOptions) {
    var alias = table._dbName;
    filter = negotiateRawSqlFilter(filter);
    var span = strategyToSpan(table, strategy);
 
    var originalDomain = process.domain || domain.create();
    originalDomain.add(transformer);
 
    var def = deferred();
 
    db.transaction()
        .then(start)
        .then(db.commit)
        .then(null, onError)
 
    function start() {
        var query = newQuery(db, table, filter, span, alias);
        var queryStream = newQueryStream(query, streamOptions);
        queryStream.on('end', def.resolve);
        queryStream.on('error', onStreamError);
        queryStream.pipe(transformer);
        return def.promise;
    }
 
    function onStreamError(e) {
        def.reject(e);
    }
 
    function onError(e) {
        transformer.emit('error', e);
        db.rollback();
    }
 
    return transformer;
}
 
module.exports = createReadStreamCoreNative;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamDefault.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamDefault.js

Statements: 22.67% (17 / 75)      Branches: 0% (0 / 30)      Functions: 0% (0 / 11)      Lines: 22.67% (17 / 75)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/ » createReadStreamDefault.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 1131 1 1 1 1 1   1                                                           1                   1       1                     1                 1           1                 1                       1       1               1    
var extractFilter = require('./query/extractFilter');
var cloneStrategy = require('./cloneStrategy');
var domain = require('domain');
var defaultBatchSize = 200;
var Readable = require('stream').Readable;
var createBatchFilter = require('./readStreamDefault/createBatchFilter');
 
function createReadStream(table, db, filter, strategy, streamOptions) {
    filter = extractFilter(filter);
    var batchFilter;
    strategy = cloneStrategy(strategy);
    var originalOrderBy = strategy.orderBy || [];
    calculateOrderBy();
    streamOptions = streamOptions || {};
    var batchSize = streamOptions.batchSize || defaultBatchSize;
    batchSize = (batchSize + 1) / 2 >> 0;
    var maxRows = strategy.limit;
    var currentRowCount = 0;
    var busy;
    var waitingforMore;
    var dtos = [];
    var lastDto;
    var done;
 
    var stream = Readable({ objectMode: true });
    stream._read = function() {
        waitingforMore = true;
        if (!busy) {
            if (dtos.length > 0)
                negotiatePushStream();
            else
                getDtos();
        }
    }
    var originalDomain = process.domain || domain.create();
    originalDomain.add(stream);
 
    function getDtos() {
        busy = true;
        return db.transaction()
            .then(getBatch)
            .then(onRows)
            .then(onDtos)
            .then(db.commit)
            .then(negotiatePushStream, onError)
    }
 
    function onRows(rows) {
        return rows.toDto(strategy);
    }
 
    function onDtos(result) {
        busy = false;
        currentRowCount += result.length;
        lastDto = result[result.length - 1];
        dtos = dtos.concat(result);
        if (currentRowCount >= maxRows || result.length < batchSize) {
            dtos.push(null);
            done = true;
        }
    }
 
    function negotiatePushStream() {
        if (dtos.length <= batchSize && !done)
            getDtos();
        if (!waitingforMore)
            return;
        waitingforMore = false;
        stream.push(dtos.shift());
    }
 
    function getBatch() {
        calculateLimit();
        calculateBatchFilter();
        return table.getMany(batchFilter, strategy);
    }
 
    function calculateLimit() {
        if (maxRows === undefined || maxRows === null)
            strategy.limit = batchSize;
        else {
            var rowsLeft = maxRows - currentRowCount;
            strategy.limit = Math.min(rowsLeft, batchSize);
        }
    }
 
    function calculateOrderBy() {
        strategy.orderBy = strategy.orderBy || [];
        if (typeof strategy.orderBy === 'string') {
            strategy.orderBy = [strategy.orderBy];
            originalOrderBy = strategy.orderBy;
        }
        var primaryColumns = table._primaryColumns;
        for (var i = 0; i < primaryColumns.length; i++) {
            strategy.orderBy.push(primaryColumns[i].alias);
        }
    }
 
    function calculateBatchFilter() {
        batchFilter = createBatchFilter(table, filter, strategy, lastDto);
    }
 
    function onError(e) {
        stream.emit('error', e);
        db.rollback();
    }
 
    return stream;
}
 
module.exports = createReadStream;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamNative.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamNative.js

Statements: 36.36% (4 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 36.36% (4 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/ » createReadStreamNative.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1   1                       1  
var createReadStreamCore = require('./createReadStreamCoreNative');
var Stream = require('stream');
 
function createReadStreamNative(table, db, filter, strategy, streamOptions) {
    var transformer = Stream.Transform({ objectMode: true });
    var started;
    transformer._transform = function(chunk, enc, cb) {
        var row = JSON.parse(chunk.result);
        transformer.push(row);
        cb();
    };
 
    return createReadStreamCore(table, db, filter, strategy, transformer, streamOptions);
}
 
module.exports = createReadStreamNative;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/delete.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/delete.js

Statements: 46.67% (7 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 46.67% (7 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1 1 1 1   1                         1  
var pushCommand = require('./commands/pushCommand');
var newDeleteCommand = require('./commands/newDeleteCommand');
var extractDeleteStrategy = require('./extractDeleteStrategy');
var negotiateRawSqlFilter = require('./column/negotiateRawSqlFilter');
var emptyPromise = require('./resultToPromise')();
 
function _delete(table, filter, strategy) {
	filter = negotiateRawSqlFilter(filter);
	strategy = extractDeleteStrategy(strategy);
	var relations = [];
	var cmds = [];
 
	cmds = newDeleteCommand(cmds, table, filter, strategy, relations);
	cmds.forEach(function(cmd) {
		pushCommand(cmd);
	});
	return emptyPromise;
}
 
module.exports = _delete;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/deleteSessionContext.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/deleteSessionContext.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 61       1  
function deleteContext() {
	delete process.domain.rdb;
}
 
module.exports = deleteContext;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecific.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecific.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111   1             1  
var getSessionSingleton = require('./getSessionSingleton');
 
function encodeDbSpecific(name, value) {
	var encode = getSessionSingleton('encode' + name);
	if (encode)
		return encode(value);
	return value;
}
 
module.exports = encodeDbSpecific;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries.js

Statements: 47.06% (8 / 17)      Branches: 0% (0 / 6)      Functions: 0% (0 / 2)      Lines: 47.06% (8 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251 1 1 1 1   1                       1         1  
var executeChanges = require('./executeQueries/executeChanges');
var popChanges = require('./popChanges');
var executeQueriesCore = require('./executeQueries/executeQueriesCore');
var newParameterized = require('./query/newParameterized');
var getSessionSingleton = require('./getSessionSingleton');
 
function executeQueries(queries) {
	var changes = popChanges();
	var lastChange = changes[changes.length-1];
	var query = queries[0];
	var multipleStatements = getSessionSingleton('multipleStatements');
	if (multipleStatements && lastChange && lastChange.parameters.length===0  && query.parameters.length===0) {
		changes.pop();
		queries[0] = newParameterized( lastChange.sql() +  ';' + query.sql(), []);
	}
 
	return executeChanges(changes).then(onDoneChanges); 
 
	function onDoneChanges() {
		return executeQueriesCore(queries);
	}
}
 
module.exports = executeQueries;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategy.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategy.js

Statements: 50% (3 / 6)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 101   1           1  
var emptyStrategy = require('../newObject')();
 
function extractDeleteStrategy(strategy) {
	if (strategy)
		return strategy;
	return emptyStrategy;
}
 
module.exports = extractDeleteStrategy;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getById.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getById.js

Statements: 60% (6 / 10)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 60% (6 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1 1   1             1   1  
 var tryGetFromCacheById = require('./tryGetFromCacheById');
 var getFromDbById = require('./getFromDbById');
 var resultToPromise = require('./resultToPromise');
 
function getById() {
	var cached =  tryGetFromCacheById.apply(null,arguments);
	if (cached)
		return resultToPromise(cached);
	return getFromDbById.apply(null,arguments);
}
 
getById.exclusive = getFromDbById.exclusive;
 
module.exports = getById;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getFirstFromDb.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getFirstFromDb.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111   1             1  
var tryGet = require('./tryGetFirstFromDb');
 
function get()  {
	var row = tryGet.apply(null,arguments);
	if (row === null)
		throw("Row not found.");
	return row;
}
 
module.exports = get;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getFromDbById.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getFromDbById.js

Statements: 42.86% (6 / 14)      Branches: 0% (0 / 4)      Functions: 0% (0 / 4)      Lines: 42.86% (6 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251   1     1             1     1             1    
var tryGetFromDbById = require('./tryGetFromDbById');
 
function get() {
    return tryGetFromDbById.apply(null, arguments).then(onResult);
 
    function onResult(row) {
        if (row === null)
            throw new Error("Row not found.");
        return row;
    }
}
 
get.exclusive = function() {
    return tryGetFromDbById.exclusive.apply(null, arguments).then(onResult);
 
    function onResult(row) {
        if (row === null)
            throw new Error("Row not found.");
        return row;
    }
}
 
module.exports = get;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getMany.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getMany.js

Statements: 55% (11 / 20)      Branches: 100% (0 / 0)      Functions: 0% (0 / 4)      Lines: 55% (11 / 20)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 301 1 1 1 1 1   1       1               1         1       1  
var newQuery = require('./newQuery');
var executeQueries = require('./executeQueries');
var resultToRows = require('./resultToRows');
var strategyToSpan = require('./strategyToSpan');
var emptyInnerJoin = require('./query/newParameterized')();
var negotiateRawSqlFilter = require('./column/negotiateRawSqlFilter');
 
function getMany(table,filter,strategy) {
	return getManyCore(table,filter,strategy);
}
 
function getManyCore(table,filter,strategy,exclusive) {
	var alias = table._dbName;
	var noOrderBy;
	filter = negotiateRawSqlFilter(filter);
	var span = strategyToSpan(table,strategy);
	var queries = newQuery([],table,filter,span,alias,emptyInnerJoin,noOrderBy,exclusive);
	return executeQueries(queries).then(onResult);
	
	function onResult(result) {
		return resultToRows(span,result);
	}
}
 
getMany.exclusive = function(table,filter,strategy) {
	return getManyCore(table,filter,strategy,true);
};
 
module.exports = getMany;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getRelativesCore.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getRelativesCore.js

Statements: 39.13% (9 / 23)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 39.13% (9 / 23)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 321 1 1 1 1   1                         1       1             1  
var executeQueries = require('./executeQueries');
var resultToRows = require('./resultToRows');
var empty = require('./resultToPromise')(false);
var negotiateExpandInverse = require('./negotiateExpandInverse');
var legNo = 0;
 
function getRelativesCore(legToQuery, parent, relation) {
	var queryContext = parent.queryContext;
	if (!queryContext)
		return empty;
	var leg = relation.toLeg();
	var filter = queryContext.filter;
	var alias = queryContext.alias;
	var innerJoin = queryContext.innerJoin;
	var limitQuery = queryContext.limitQuery;
	var query = legToQuery([], alias, leg, legNo, filter, innerJoin, limitQuery);
 
	return executeQueries(query).then(onResult).then(onRows);
 
	function onResult(result) {
		return  resultToRows(leg.span, result);
	}
 
	function onRows(rows) {
		queryContext.expand(relation);
		negotiateExpandInverse(parent, relation, rows);
		return rows;
	}
}
 
module.exports = getRelativesCore;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionContext.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionContext.js

Statements: 50% (1 / 2)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (1 / 2)      Ignored: none     

1 2 3 41      
module.exports = function() {
	return process.domain.rdb;	
};
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionSingleton.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionSingleton.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 61   1      
var getSessionContext = require('./getSessionContext');
 
module.exports = function(name) {
	return getSessionContext()[name];
};
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasMany.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasMany.js

Statements: 28.57% (4 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 28.57% (4 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261 1   1                                         1  
var newManyRelation = require('./newManyRelation');
var newRelatedTable = require('./newRelatedTable');
 
function newOne(joinRelation) {
	var c = {};
	var parentTable = joinRelation.childTable;
 
	c.as = function (alias) {	
		joinRelation.rightAlias = alias;
		var relation = newManyRelation(joinRelation);
		parentTable._relations[alias] = relation;
		
		Object.defineProperty(parentTable, alias, {
    		get: function() {
        		return newRelatedTable([relation]);
    		}
		});
 
		return relation;
	};
 
	return c;
}
 
module.exports = newOne;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasOne.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasOne.js

Statements: 28.57% (4 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 28.57% (4 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251 1   1                                       1  
var newOneRelation = require('./newOneRelation');
var newRelatedTable = require('./newRelatedTable');
 
function newOne(joinRelation) {
	var c = {};
	var parentTable = joinRelation.childTable;
 
	c.as = function (alias) {	
		joinRelation.rightAlias = alias;
		var relation = newOneRelation(joinRelation);
		parentTable._relations[alias] = relation;
 
		Object.defineProperty(parentTable, alias, {
    		get: function() {
        		return newRelatedTable([relation]);
    		}
		});
		return relation;
	};
 
	return c;
}
 
module.exports = newOne;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/insert.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/insert.js

Statements: 45.45% (5 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 45.45% (5 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1 1   1                 1  
var newRow = require('./commands/newRow');
var newInsertCommand = require('./commands/newInsertCommand');
var pushCommand = require('./commands/pushCommand');
 
function insert(table, id, id2)  {
	var args = [].slice.call(arguments);
	var row = newRow.apply(null, args);
	row = table._cache.tryAdd(row);
	var cmd = newInsertCommand(table, row);
	pushCommand(cmd);
	return row;
}
 
module.exports = insert;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/isDirty.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/isDirty.js

Statements: 100% (2 / 2)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (2 / 2)      Ignored: none     

1 2 3 41   1  
var getSessionSingleton = require('./getSessionSingleton');
 
module.exports = getSessionSingleton.bind(null,'isDirty');
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/join.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/join.js

Statements: 20% (5 / 25)      Branches: 0% (0 / 2)      Functions: 0% (0 / 5)      Lines: 20% (5 / 25)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 441 1   1                       1                                                   1    
var newJoinRelation = require('./newJoinRelation');
var newRelatedTable = require('./newRelatedTable');
 
function newJoin(parentTable, childTable) {
    var c = {};
    var columnNames = [];
 
    c.by = function() {
        for (var i = 0; i < arguments.length; i++) {
            verifyColumnExists(arguments[i]);
            columnNames.push(arguments[i]);
        }
        return c;
    };
 
    function verifyColumnExists(columnName) {
        var columns = parentTable._columns;
        for (var i = 0; i < columns.length; i++) {
            if (columns[i]._dbName === columnName)
                return;
 
        }
        throw new Error('Unknown column: ' + columnName);
    }
 
    c.as = function(alias) {
        var relation = newJoinRelation(parentTable, childTable, columnNames);
        relation.leftAlias = alias;
        parentTable._relations[alias] = relation;
 
        Object.defineProperty(parentTable, alias, {
            get: function() {
                return newRelatedTable([relation]);
            }
        });
 
        return relation;
    };
    return c;
}
 
module.exports = newJoin;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/log.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/log.js

Statements: 66.67% (4 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131     1       1       1  
var logger = function() {
};
 
function log() {
	logger.apply(null, arguments);
}
 
log.registerLogger = function(cb) {
	logger = cb;
};
 
module.exports = log;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateAddStrategy.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateAddStrategy.js

Statements: 23.08% (3 / 13)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 23.08% (3 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 212   1                   1                
var emptyStrategy = require('./emptyStrategy');
 
function negotiate(table) {
	var argsCount = arguments.length;
	var args = [];
	for (var i = 0; i < arguments.length; i++) {
		args.push(arguments[i]);
	}
	if (noStrategy())
		args.push(emptyStrategy);
	return args;
 
	function noStrategy() {
		var columnCount = table._primaryColumns.length;
		return (columnCount+2 != argsCount);
 
	}
}
 
module.exports = negotiate;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverse.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverse.js

Statements: 25% (2 / 8)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/ » negotiateExpandInverse.js
1 2 3 4 5 6 7 8 9 10 111                 1  
function negotiateExpandInverse(parent, relation, children) {
	var joinRelation = relation.joinRelation;
	if (!joinRelation)
		return;
	var firstChild = children[0];
	if (firstChild)
		firstChild.queryContext.expand(joinRelation);
}
 
module.exports = negotiateExpandInverse;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCache.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCache.js

Statements: 11.11% (7 / 63)      Branches: 0% (0 / 16)      Functions: 0% (0 / 9)      Lines: 11.11% (7 / 63)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 971   1                         1                                   1                                             1                                         1                                   1  
var newEmitEvent = require('../emitEvent');
 
function cacheCore() {
    var emitAdded = newEmitEvent();
    var emitRemoved = newEmitEvent();
    var c = {};
    var cache = {};
    var keyLength;
 
    c.tryGet = function(key) {
        var index = 0;
        var keyLength = key.length;
 
        return tryGetCore(cache, index);    
 
        function tryGetCore(cache, index) {
            var keyValue = key[index];
            var cacheValue = cache[keyValue];
            if (typeof cacheValue === 'undefined')
                return null;
            if (keyLength - 1 == index)
                return cacheValue;
            return tryGetCore(cache[keyValue], ++index);
        }
 
    };
 
    c.tryAdd = function(key, result) {
        var index = 0;
        keyLength = key.length;
        
        return  addCore(cache, index);
        
        function addCore(cache, index) {
            var keyValue = key[index];
                
            if (keyLength - 1 == index) {                
                if (keyValue in cache)
                    return cache[keyValue];
                
                cache[keyValue] = result;
                emitAdded(result);
                return result;
            }
            if (! (keyValue in cache))
                cache[keyValue] = {};            
            return addCore(cache[keyValue], ++index);
        }
    };
 
    c.tryRemove = function(key) { 
        var index = 0;
        var keyLength = key.length;
 
        return tryRemoveCore(cache, index);
 
        function tryRemoveCore(cache, index) {
            var keyValue = key[index];
            if (!(keyValue in cache))
                return null;
            var cacheValue = cache[keyValue];
            if (keyLength - 1 == index) {
                delete cache[keyValue];
                emitRemoved(cacheValue);
                return cacheValue;
            }
                
            return tryRemoveCore(cache[keyValue], ++index);
        }
 
    };
 
    c.getAll = function() {
        var index = 0;
        var result = [];
        getAllCore(cache, index);
 
        function getAllCore(cache, index) {
            for (var name in cache) {
                var value = cache[name];
                if (index === keyLength - 1)
                    result.push(value);
                else
                    getAllCore(value, index+1);
            }
        }
        return result;
    };
 
    c.subscribeAdded = emitAdded.add;
    c.subscribeRemoved = emitRemoved.add;
 
    return c;
}
 
module.exports = cacheCore;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCascadeDeleteStrategy.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCascadeDeleteStrategy.js

Statements: 25% (5 / 20)      Branches: 100% (0 / 0)      Functions: 0% (0 / 4)      Lines: 25% (5 / 20)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/ » newCascadeDeleteStrategy.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 311 1   1                                         1         1  
var addSubStrategies = _addSubStrategies;
var newObject = require('../newObject');
 
function newCascadeDeleteStrategy(strategy, table) {
	var relations = table._relations;
	var relationName;
 
	var c = {};
	c.visitJoin = function(){};
	c.visitOne = function(relation) {
		var subStrategy = newObject();
		strategy[relationName] = subStrategy;
		addSubStrategies(subStrategy, relation.childTable);
	};
 
	c.visitMany = c.visitOne;
 
	for(relationName in relations) {
		var relation = relations[relationName];
		relation.accept(c);
	}
	return strategy;
}
 
function _addSubStrategies(strategy, table) {	
	addSubStrategies = require('./newCascadeDeleteStrategy');
	addSubStrategies(strategy, table);
}
 
module.exports = newCascadeDeleteStrategy;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCache.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCache.js

Statements: 18.52% (5 / 27)      Branches: 100% (0 / 0)      Functions: 0% (0 / 8)      Lines: 18.52% (5 / 27)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 451 1   1                                                                   1           1  
var newId = require('../newId');
var _getCache = require('./domainCache/getCache');
 
function newDomainCache() {
	var c = {};
	var id = newId();
 
	c.tryGet = function(key) {		
		var cache = getCache();		
		return cache.tryGet(key);
	};
 
	c.tryAdd = function(key, value) {
		var cache = getCache();		
		return cache.tryAdd(key,value);
	};
 
	c.getAll = function() {
		var cache = getCache();		
		return cache.getAll();	
	};
 
	c.tryRemove = function(key) {
		var cache = getCache();		
		return cache.tryRemove(key);
	};
 
	c.subscribeAdded = function(onAdded) {
		var cache = getCache();		
		return cache.subscribeAdded(onAdded);
	};
 
	c.subscribeRemoved = function(onRemoved) {
		var cache = getCache();		
		return cache.subscribeRemoved(onRemoved);
	};
 
	function getCache() {
		return _getCache(id);
	}
	return c;
}
 
module.exports = newDomainCache;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newGetRelated.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newGetRelated.js

Statements: 40% (6 / 15)      Branches: 0% (0 / 4)      Functions: 0% (0 / 4)      Lines: 40% (6 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261   1 1               1         1             1    
var isDirty = require('./isDirty');
 
function newGetRelated(parent, relation) {
    function getRelated() {
        if (getRelated.expanded)
            return relation.getFromCache(parent);
        if (isDirty()) {
            return relation.getFromDb(parent).then(onFromDb);
        }
        return relation.getRelatives(parent).then(onRelatives);
 
        function onFromDb(rows) {
            getRelated.expanded = true;
            return rows;
        }
 
        function onRelatives() {
            return relation.getFromCache(parent);
        }
    }
	return getRelated;
}
 
module.exports = newGetRelated;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelation.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelation.js

Statements: 13.46% (7 / 52)      Branches: 0% (0 / 10)      Functions: 0% (0 / 13)      Lines: 13.46% (7 / 52)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 931             1                                                                                                     1                   1                   1       1               1    
var newLeg = require('./relation/newJoinLeg'),
    getById = require('./getById'),
    nullPromise = require('./nullPromise'),
    newGetRelated = require('./newGetRelated'),
    getRelatives = require('./joinRelation/getRelatives'),
    tryGetFromCacheById = require('./tryGetFromCacheById');
 
function _newJoin(parentTable, childTable, columnNames) {
    var c = {};
    c.parentTable = parentTable;
    c.childTable = childTable;
    c.columns = [];
    var columns = parentTable._columns;
    addColumns();
 
    c.accept = function(visitor) {
        visitor.visitJoin(c);
    };
 
    c.toLeg = function() {
        return newLeg(c);
    };
 
    c.getFromDb = function(parent) {
        var key = parentToKey(parent);
        if (key.some(isNullOrUndefined)) {
            return nullPromise;
        }
        var args = [childTable].concat(key);
        return getById.apply(null, args);
    };
 
    c.getFromCache = c.getFromDb;
 
    c.toGetRelated = function(parent) {
        return newGetRelated(parent, c);
    };
 
    c.getRelatives = function(parent) {
        return getRelatives(parent, c);
    };
 
    c.expand = function(parent) {
        parent.expand(c.leftAlias);
    };
 
    c.getRowsSync = function(parent) {
        var key = parentToKey(parent);
 
        if (key.some(isNullOrUndefined)) {
            return null;
        }
        var args = [childTable].concat(key);
        return tryGetFromCacheById.apply(null, args);
    };
 
    return c;
 
    function addColumns() {
        var numberOfColumns = columnNames.length;
        for (var i = 0; i < columns.length; i++) {
            var curColumn = columns[i];
            tryAdd(curColumn);
            if (numberOfColumns === c.columns.length)
                return;
        }
    }
 
    function tryAdd(column) {
        for (var i = 0; i < columnNames.length; i++) {
            var name = columnNames[i];
            if (column._dbName === name) {
                c.columns.push(column);
                return;
            }
        }
    }
 
    function isNullOrUndefined(item) {
        return item === null || item === undefined;
    }
 
    function parentToKey(parent) {
        var primaryKeys = c.columns.map(function(column) {
            return parent[column.alias];
        });
        return primaryKeys;
    }
}
 
module.exports = _newJoin;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelation.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelation.js

Statements: 26.67% (8 / 30)      Branches: 100% (0 / 0)      Functions: 0% (0 / 8)      Lines: 26.67% (8 / 30)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 521 1 1 1 1 1   1                                                                                   1    
var newLeg = require('./relation/newManyLeg');
var newManyCache = require('./relation/newManyCache');
var newForeignKeyFilter = require('./relation/newForeignKeyFilter');
var getRelatives = require('./oneRelation/getRelatives');
var resultToPromise = require('./resultToPromise');
var newGetRelated = require('./newGetRelated');
 
function newManyRelation(joinRelation) {
    var c = {};
    var manyCache = newManyCache(joinRelation);
 
    c.joinRelation = joinRelation;
    c.childTable = joinRelation.parentTable;
 
    c.accept = function(visitor) {
        visitor.visitMany(c);
    };
 
    c.getFromCache = function(parent) {
        var row = manyCache.tryGet(parent);
        return resultToPromise(row);
    };
 
    c.getFromDb = function(parent) {
        var filter = newForeignKeyFilter(joinRelation, parent);
        return c.childTable.getMany(filter);
    };
 
    c.getRelatives = function(parent) {
        return getRelatives(parent, c);
    };
 
    c.toGetRelated = function(parent) {
        return newGetRelated(parent, c);
    };
 
    c.expand = function(parent) {
        return parent.expand(joinRelation.rightAlias);
    };
 
    c.getRowsSync = manyCache.tryGet;
 
    c.toLeg = function() {
        return newLeg(c);
    };
 
    return c;
}
 
module.exports = newManyRelation;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelation.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelation.js

Statements: 26.67% (8 / 30)      Branches: 100% (0 / 0)      Functions: 0% (0 / 8)      Lines: 26.67% (8 / 30)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 511 1 1 1 1 1   1                                                                                   1  
var newLeg = require('./relation/newOneLeg');
var newOneCache = require('./relation/newOneCache');
var newForeignKeyFilter = require('./relation/newForeignKeyFilter');
var getRelatives = require('./oneRelation/getRelatives');
var resultToPromise = require('./resultToPromise');
var newGetRelated = require('./newGetRelated');
 
function newOneRelation(joinRelation) {
    var c = {};
    var oneCache = newOneCache(joinRelation);
 
    c.joinRelation = joinRelation;
    c.childTable = joinRelation.parentTable;
 
    c.accept = function(visitor) {
        visitor.visitOne(c);
    };
 
    c.getFromCache = function(parent) {
        var row = oneCache.tryGet(parent);
        return resultToPromise(row);
    };
 
    c.getFromDb = function(parent) {
        var filter = newForeignKeyFilter(joinRelation, parent);
        return c.childTable.tryGetFirst(filter);
    };
 
    c.getRelatives = function(parent) {
        return getRelatives(parent, c);
    };
 
    c.toGetRelated = function(parent) {
        return newGetRelated(parent, c);
    };
 
    c.expand = function(parent) {
        return parent.expand(joinRelation.rightAlias);
    };
 
    c.getRowsSync = oneCache.tryGet;
 
    c.toLeg = function() {
        return newLeg(c);
    };
 
    return c;
}
 
module.exports = newOneRelation;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newPrimaryKeyFilter.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newPrimaryKeyFilter.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151                       1    
function primaryKeyFilter(table,id,id2,etc) {
	var primaryColumns = table._primaryColumns;
	var key = arguments[1];
	var filter = primaryColumns[0].equal(key);
	for (var i = 1; i < primaryColumns.length; i++) {
		key = arguments[i+1];
		var colFilter = primaryColumns[i].equal(key);
		filter = filter.and(colFilter);
	}	
	return filter;
}
 
module.exports = primaryKeyFilter;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newQuery.js

Statements: 50% (8 / 16)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (8 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1 1 1 1 1   1                       1  
var newSingleQuery = require('./query/newSingleQuery');
var addSubQueries = require('./query/addSubQueries');
var extractFilter = require('./query/extractFilter');
var extractOrderBy = require('./query/extractOrderBy');
var extractLimit = require('./query/extractLimit');
var extractLimitQuery = require('./query/extractLimitQuery');
 
function newQuery(queries,table,filter,span,alias,innerJoin,orderBy,exclusive) {	
	filter = extractFilter(filter);
	orderBy = extractOrderBy(table,alias,span.orderBy,orderBy);
	var limit = extractLimit(span);
	var singleQuery = newSingleQuery(table,filter,span,alias,innerJoin,orderBy,limit,exclusive);
	queries.push(singleQuery);
	singleQuery.queryContext.limitQuery  = extractLimitQuery(table, filter, span, alias, orderBy, limit);
 
	addSubQueries(queries,table,filter,span,alias,innerJoin);
	return queries;
}
 
module.exports = newQuery;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRelatedTable.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRelatedTable.js

Statements: 28.57% (8 / 28)      Branches: 100% (0 / 0)      Functions: 0% (0 / 6)      Lines: 28.57% (8 / 28)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 481 1 1   1                     1             1                                     1         1  
	var newRelatedColumn = require('./relatedTable/relatedColumn');
var nextRelatedTable = _nextRelatedTable;
var subFilter = require('./relatedTable/subFilter');
 
function newRelatedTable(relations) {
	var table = relations[relations.length-1].childTable;
	var columns = table._columns;	
	var c = {};
 
	for (var i = 0; i < columns.length; i++) {
		var col = columns[i];
		c[col.alias] = newRelatedColumn(col,relations);
	}
	defineChildren();
 
	function defineChildren() {
		var childRelations = table._relations;
		for(var alias in childRelations) {	
			defineChild(alias);
		}
	}
 
	function defineChild(alias) {		
		var relation = table._relations[alias];    	
    	var children = relations.slice(0);    				    				
    	children.push(relation);
 
		Object.defineProperty(c, alias, {
    		get: function() {        			
    	   		return nextRelatedTable(children);
    		}
		});	
	}
 
	c.exists = function() {
		return subFilter(relations);
	};
 
	return c;
}
 
function _nextRelatedTable(relations) {
	nextRelatedTable = require('./newRelatedTable');
	return nextRelatedTable(relations);
}
 
module.exports = newRelatedTable;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRowCache.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRowCache.js

Statements: 15.79% (6 / 38)      Branches: 100% (0 / 0)      Functions: 0% (0 / 7)      Lines: 15.79% (6 / 38)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 601   1           1                                 1             1                                                   1  
var newDomainCache = require('./newDomainCache');
 
function newRowCache(table) {
	var c = {};
	var cache = newDomainCache();
	var pkNames;
	var rowToKey = firstRowToKey;
 
	function getPkNames() {
		var names = {};		
		var primaryColumns = table._primaryColumns;		
		var keyLength = primaryColumns.length;
		for (var i = 0; i < keyLength; i++) {
			var column = primaryColumns[i];
			names[column.alias] = null;
		}
		return names;
	}
 
	c.tryGet = function(row) {
		var key = rowToKey(row);
		return cache.tryGet(key);
 
	};
 
	function firstRowToKey(row) {
		pkNames = getPkNames();
		rowToKey = nextRowToKey;
		table = null;
		return rowToKey(row);
	}
 
	function nextRowToKey(row) {		
		var key = [];
		for(var pkName in pkNames) {
			key.push(row[pkName]);
		}
		return key;
	}
 
	c.tryAdd = function(row) {
		var key = rowToKey(row);
		return cache.tryAdd(key, row);
	};
 
	c.tryRemove = function(row) {
		var key = rowToKey(row);
		cache.tryRemove(key);
	};
 
	c.subscribeAdded = cache.subscribeAdded;	
	c.subscribeRemoved = cache.subscribeRemoved;
	
	c.getAll = cache.getAll;
 
	return c;
}
 
module.exports = newRowCache;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newThrow.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newThrow.js

Statements: 57.14% (4 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121   1   1           1  
var tryReleaseDbClient = require('./tryReleaseDbClient');
 
function newThrow(e, previousPromise) {
	return previousPromise.then(throwError, throwError);
	function throwError() {
		tryReleaseDbClient();
		throw e;
	}
}
 
module.exports = newThrow;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/notifyDirty.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/notifyDirty.js

Statements: 100% (2 / 2)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (2 / 2)      Ignored: none     

1 2 31 1  
var setSessionSingleton = require('./setSessionSingleton');
module.exports = setSessionSingleton.bind(null, 'isDirty', true);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/nullPromise.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/nullPromise.js

Statements: 100% (1 / 1)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (1 / 1)      Ignored: none     

1 21  
module.exports = require('./promise')(null);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/objectToCallback.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/objectToCallback.js

Statements: 50% (2 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 50% (2 / 4)      Ignored: none     

1 2 3 4 5 6 7 81     1        
module.exports = function(object) {
	return invoke;
 
	function invoke(resolve) {
		resolve(object);
	}
};
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChanges.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChanges.js

Statements: 28.57% (4 / 14)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 28.57% (4 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201 1   1                             1  
var getChangeSet = require('./commands/getChangeSet');
var compressChanges = require('./commands/compressChanges');
 
function popChanges() {	
	var changeSet = getChangeSet();
	var length = changeSet.length;
	if (length > 0) {
		var lastCmd = changeSet[length-1];
		if (lastCmd.endEdit)
			lastCmd.endEdit();
		var compressed = compressChanges(changeSet);
		changeSet.length = 0;
		return compressed;
	}
	return changeSet;
 
}
 
module.exports = popChanges;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/promise.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/promise.js

Statements: 90% (9 / 10)      Branches: 50% (1 / 2)      Functions: 100% (1 / 1)      Lines: 90% (9 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141 1 1   1 1 1       1 1 1  
var promise = require('promise/domains');
var deferred = require('deferred');
var objectToCallback = require('./objectToCallback');
 
function newPromise(func) {
	Eif (!func)
		return deferred.resolve();
	return new promise(func);
}
 
newPromise.all = promise.all;
newPromise.denodeify = promise.denodeify;
module.exports = newPromise;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/releaseDbClient.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/releaseDbClient.js

Statements: 50% (4 / 8)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 50% (4 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121 1   1             1  
var getSessionSingleton = require('./getSessionSingleton');
var deleteSessionContext = require('./deleteSessionContext')
 
function release() {
	var done = getSessionSingleton('dbClientDone');
	deleteSessionContext();
	if (done)
		done();
}
 
module.exports = release;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToPromise.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToPromise.js

Statements: 100% (4 / 4)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (4 / 4)      Ignored: none     

1 2 3 4 5 6 7 8 9  1   1 2     1  
 
var deferred = require('deferred');
 
function resultToPromise(result) {
	return deferred.resolve(result);
}
 
module.exports = resultToPromise;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows.js

Statements: 53.33% (8 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 4)      Lines: 53.33% (8 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261 1 1   1     1             1         1         1  
var all = require('./promise').all;
var subResultToRows = _subResultToRows;
var dbRowsToRows = require('./resultToRows/dbRowsToRows');
 
function resultToRows(span,result) {
	var rowsPromise = result[0].then(onResult);
 
	function onResult(result) {
		return dbRowsToRows(span,result);
	}
 
	result.shift();
	return subResultToRows(span, result).then(onSubRows);
 
	function onSubRows() {
		return rowsPromise;
	}
}
 
function _subResultToRows(span,result) {
	subResultToRows = require('./resultToRows/subResultToRows');
	return subResultToRows(span,result);
}
 
module.exports = resultToRows;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rollback.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rollback.js

Statements: 61.54% (8 / 13)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 61.54% (8 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221 1 1 1 1 1   1                       1    
var rollbackCommand = require('./commands/rollbackCommand');
var executeQuery = require('./executeQueries/executeQuery');
var releaseDbClient = require('./releaseDbClient');
var popChanges = require('./popChanges');
var newThrow = require('./newThrow');
var resultToPromise = require('./resultToPromise');
 
function rollback(e) {
    var executeRollback = executeQuery.bind(null, rollbackCommand);
    var chain = resultToPromise()
        			.then(popChanges)
        			.then(executeRollback)
        			.then(releaseDbClient);
 
    if (e)
        return newThrow(e, chain);
    return chain;
}
 
module.exports = rollback;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rowArray.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rowArray.js

Statements: 37.93% (11 / 29)      Branches: 0% (0 / 2)      Functions: 0% (0 / 6)      Lines: 37.93% (11 / 29)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 581 1 1 1   1                           1       1               1                   1       1                   1    
var extractStrategy = require('./resultToRows/toDto/extractStrategy');
var resultToPromise = require('./resultToPromise')
var orderBy = require('./rowArray/orderBy');
var negotiateNextTick = require('./rowArray/negotiateNextTick');
 
function newRowArray(table) {
    var c = [];
 
    Object.defineProperty(c, "toJSON", {
        enumerable: false,
        value: toJSON
    });
 
    Object.defineProperty(c, "toDto", {
        enumerable: false,
        writable: true,
        value: toDto
    });
 
    function toJSON(optionalStrategy) {
        return c.toDto.apply(null, arguments).then(JSON.stringify);
    }
 
    function toDto(optionalStrategy) {
        var args = arguments;
        var result = [];
        var length = c.length;
        var i = -1;
 
        return resultToPromise().then(toDtoAtIndex);
 
        function toDtoAtIndex() {
            i++;
            if (i === length) {
                return orderBy(optionalStrategy, result);
            }
            var row = c[i];
            return getDto()
                    .then(onDto)
                    .then(toDtoAtIndex)
 
            function getDto() {
                return row.toDto.apply(row,args);
            }            
 
            function onDto(dto) {
                result.push(dto);
                return negotiateNextTick(i);
            }
        }
    }
 
    return c;
}
 
module.exports = newRowArray;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/setSessionSingleton.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/setSessionSingleton.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 61   1      
var getSessionContext = require('./getSessionContext');
 
module.exports = function(name, value) {
	getSessionContext()[name] = value;
};
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/strategyToSpan.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/strategyToSpan.js

Statements: 21.74% (5 / 23)      Branches: 0% (0 / 4)      Functions: 0% (0 / 3)      Lines: 21.74% (5 / 23)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 331   1             1                       1                   1  
var newCollection = require('../newCollection');
 
function toSpan(table,strategy) {
	var span = {};
	span.legs = newCollection();
	span.table = table;
	applyStrategy(table,span,strategy);
	return span;
 
	function applyStrategy(table,span,strategy) {
		var legs = span.legs;
		if(!strategy) 
			return;		
		for (var name in strategy) {
			if (table._relations[name])
				addLeg(legs,table,strategy,name);
			else
				span[name] = strategy[name];
		}					
	}	
			
	function addLeg(legs,table,strategy,name) {		
		var relation = table._relations[name];
		var leg = relation.toLeg();
		legs.add(leg);		
		var subStrategy = strategy[name];
		var childTable = relation.childTable;
		applyStrategy(childTable,leg.span,subStrategy);
	}
}
 
module.exports = toSpan;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/streamEager.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/streamEager.js

Statements: 13.79% (4 / 29)      Branches: 100% (0 / 0)      Functions: 0% (0 / 4)      Lines: 13.79% (4 / 29)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 632                                                                                 1         1                 1              
var rdb = require('../index'),
    resetDemo = require('../../rdb-demo/db/resetDemo');
 
var Order = rdb.table('_order');
var OrderLine = rdb.table('_orderLine');
 
Order.primaryColumn('oId').guid().as('id');
Order.column('oOrderNo').string().as('orderNo');
Order.column('oFoo').boolean().as('foo');
 
OrderLine.primaryColumn('lId').guid().as('id');
OrderLine.column('lOrderId').guid().as('orderId');
OrderLine.column('lProduct').string().as('product');
 
rdb.log(console.log);
 
var line_order_relation = OrderLine.join(Order).by('lOrderId').as('order');
Order.hasMany(line_order_relation).as('lines');
 
// var db = rdb('postgres://postgres:postgres@localhost/test');
var db = rdb.sqlite(__dirname + '/../../rdb-demo/sqlite/db/rdbDemo');
 
 
var emptyFilter = Order.foo.greaterThan(new Date());
var strategy = {
    lines: {
        orderBy: 'product'
    },
    orderBy: 'orderNo',
    limit: 3
};
 
var counter = 0;
var data = '';
module.exports = resetDemo()
    .then(function() {
        Order.createJSONReadStream(db, emptyFilter, strategy).on('data', printOrder).on('error', onError).on('end', onEnd);
 
    }).then(null, onError);
 
 
function onError(e) {
    console.log(e.stack);
}
 
 
function onEnd() {
    // console.log('end...' + counter);
    var obj = JSON.parse(data);
    for (var i = 0; i < obj.length; i++) {
        var dto = obj[i]
        console.log(dto);
    }
}
 
function printOrder(order) {
    // console.log(typeof order);
    counter++;
    data += order;
    // console.log(order);
}
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetById.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetById.js

Statements: 60% (6 / 10)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 60% (6 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141 1 1   1           1   1  
 var tryGetFromCacheById = require('./tryGetFromCacheById');
 var tryGetFromDbById = require('./tryGetFromDbById');
 var resultToPromise = require('./resultToPromise');
 
function get() {
	var cached =  tryGetFromCacheById.apply(null,arguments);
	if (cached)
		return resultToPromise(cached);
	return tryGetFromDbById.apply(null,arguments);
}
get.exclusive = tryGetFromDbById.exclusive;
 
module.exports = get;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFirstFromDb.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFirstFromDb.js

Statements: 46.67% (7 / 15)      Branches: 0% (0 / 2)      Functions: 0% (0 / 4)      Lines: 46.67% (7 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261 1   1         1           1         1       1    
var getMany = require('./getMany');
var util = require('util');
 
function tryGet(table, filter, strategy) {
    strategy = setLimit(strategy);
    return getMany(table, filter, strategy).then(filterRows);
}
 
function filterRows(rows) {
    if (rows.length > 0)
        return rows[0];
    return null;
}
 
tryGet.exclusive = function(table, filter, strategy) {
    strategy = setLimit(strategy);
    return getMany.exclusive(table, filter, strategy).then(filterRows);
}
 
function setLimit(strategy) {
    return util._extend({ limit: 1 }, strategy);
}
 
module.exports = tryGet;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFromCacheById.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFromCacheById.js

Statements: 37.5% (3 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131         1           1  
function tryGet(table, id, id2, optionalStrategy) {
	var fakeRow = {};
	var args = arguments;
	table._primaryColumns.forEach(addPkValue);
 
	function addPkValue(pkColumn, index){
		fakeRow[pkColumn.alias] = args[index + 1];
	}
 
	return table._cache.tryGet(fakeRow);
}
module.exports = tryGet;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFromDbById.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFromDbById.js

Statements: 42.86% (6 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 42.86% (6 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1 1   1             1             1    
var newPrimaryKeyFilter = require('./newPrimaryKeyFilter');
var tryGetFirstFromDb = require('./tryGetFirstFromDb');
var extractStrategy = require('./tryGetFromDbById/extractStrategy');
 
function tryGet() {
    var filter = newPrimaryKeyFilter.apply(null, arguments);
    var table = arguments[0];
    var strategy = extractStrategy.apply(null, arguments);
    return tryGetFirstFromDb(table, filter, strategy);
}
 
tryGet.exclusive = function tryGet() {
    var filter = newPrimaryKeyFilter.apply(null, arguments);
    var table = arguments[0];
    var strategy = extractStrategy.apply(null, arguments);
    return tryGetFirstFromDb.exclusive(table, filter, strategy);
}
 
module.exports = tryGet;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryReleaseDbClient.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryReleaseDbClient.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151   1                   1    
var release = require('./releaseDbClient');
 
function tryReleaseDbClient() {
    try {
        release();
    } 
    catch (e) {
 
    }
 
}
 
module.exports = tryReleaseDbClient;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/updateField.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/updateField.js

Statements: 55.56% (5 / 9)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 55.56% (5 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131 1 1   1             1  
var newUpdateCommand = require('./commands/newUpdateCommand');
var pushCommand = require('./commands/pushCommand');
var lastCommandMatches = require('./commands/lastCommandMatches');
 
function updateField(table, column, row) {
	if (lastCommandMatches(row))
		return;
	var command = newUpdateCommand(table, column, row);
	pushCommand(command);
}
 
module.exports = updateField;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/beginSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/beginSpec/

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/beginSpec/
File Statements Branches Functions Lines
req.js 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/beginSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/beginSpec/req.js

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  2         1                    
 
var a  = require('a');
var mock = a.mock;
var requireMock  = a.requireMock;
 
 
function act(c){		
	c.beginCommand = requireMock('./commands/beginCommand');
	c.executeQuery = requireMock('./executeQueries/executeQuery');
	c.setSessionSingleton = requireMock('./setSessionSingleton');
	
	c.sut = require('../begin');
}
 
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/beginSpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/beginSpec/req/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/beginSpec/req/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/beginSpec/req/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/beginSpec/req/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should set changeSet on session').assertDoesNotThrow(c.setSessionSingleton.verify)
	.it('should return executeQuery begin promise').assertEqual(c.expected, c.returned)
;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/cascadeDeleteSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/cascadeDeleteSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/cascadeDeleteSpec/
File Statements Branches Functions Lines
whenCascadeDelete.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/cascadeDeleteSpec/whenCascadeDelete.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/cascadeDeleteSpec/whenCascadeDelete.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should forward to delete with cascade strategy').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/cloneStrategySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/cloneStrategySpec/

Statements: 27.27% (3 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 27.27% (3 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/cloneStrategySpec/
File Statements Branches Functions Lines
clone.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
whenClone.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/cloneStrategySpec/clone.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/cloneStrategySpec/clone.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 142   1                      
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
 
	c.sut = require('../cloneStrategy');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/cloneStrategySpec/whenClone.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/cloneStrategySpec/whenClone.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 202                                      
var when = require('a').when;
var c = {};
 
when(c)
    .it('should clone simple').assertDeepEqual({}, c.sut({}))
    .it('should clone simple 2').assertDeepEqual({}, c.sut({}))
    .it('should medium complex').assertDeepEqual({ a: '1', b: 2, c: undefined}, c.sut({ a: '1', b: 2, c: undefined }))
    .it('should very complex').assertDeepEqual({
        a: '1',
        b: 2,
        c: { foo: 1 },
        d: [{ bar: { f: 'fly' } }, 2]
    }, c.sut({
        a: '1',
        b: 2,
        c: { foo: 1 },
        d: [{ bar: { f: 'fly' } }, 2]
    }))
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/

Statements: 33.97% (107 / 315)      Branches: 0% (0 / 28)      Functions: 0% (0 / 48)      Lines: 33.97% (107 / 315)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/
File Statements Branches Functions Lines
binary.js 62.5% (5 / 8) 100% (0 / 0) 0% (0 / 1) 62.5% (5 / 8)
boolean.js 55.56% (5 / 9) 100% (0 / 0) 0% (0 / 1) 55.56% (5 / 9)
date.js 62.5% (5 / 8) 100% (0 / 0) 0% (0 / 1) 62.5% (5 / 8)
encodeFilterArg.js 40% (2 / 5) 0% (0 / 2) 0% (0 / 1) 40% (2 / 5)
equal.js 41.67% (5 / 12) 0% (0 / 2) 0% (0 / 1) 41.67% (5 / 12)
extractAlias.js 40% (2 / 5) 0% (0 / 2) 0% (0 / 1) 40% (2 / 5)
greaterThan.js 44.44% (4 / 9) 100% (0 / 0) 0% (0 / 1) 44.44% (4 / 9)
greaterThanOrEqual.js 44.44% (4 / 9) 100% (0 / 0) 0% (0 / 1) 44.44% (4 / 9)
guid.js 62.5% (5 / 8) 100% (0 / 0) 0% (0 / 1) 62.5% (5 / 8)
in.js 27.78% (5 / 18) 0% (0 / 2) 0% (0 / 1) 27.78% (5 / 18)
json.js 62.5% (5 / 8) 100% (0 / 0) 0% (0 / 1) 62.5% (5 / 8)
lessThan.js 44.44% (4 / 9) 100% (0 / 0) 0% (0 / 1) 44.44% (4 / 9)
lessThanOrEqual.js 44.44% (4 / 9) 100% (0 / 0) 0% (0 / 1) 44.44% (4 / 9)
negotiateNextAndFilter.js 40% (2 / 5) 0% (0 / 2) 0% (0 / 1) 40% (2 / 5)
negotiateNextOrFilter.js 40% (2 / 5) 0% (0 / 2) 0% (0 / 1) 40% (2 / 5)
negotiateRawSqlFilter.js 19.05% (4 / 21) 0% (0 / 8) 0% (0 / 3) 19.05% (4 / 21)
newBoolean.js 19.44% (7 / 36) 100% (0 / 0) 0% (0 / 7) 19.44% (7 / 36)
newColumn.js 16.36% (9 / 55) 100% (0 / 0) 0% (0 / 9) 16.36% (9 / 55)
newDecodeCore.js 33.33% (2 / 6) 0% (0 / 2) 0% (0 / 2) 33.33% (2 / 6)
newEncodeSafe.js 30% (3 / 10) 0% (0 / 4) 0% (0 / 2) 30% (3 / 10)
notEqual.js 41.67% (5 / 12) 0% (0 / 2) 0% (0 / 1) 41.67% (5 / 12)
numeric.js 55.56% (5 / 9) 100% (0 / 0) 0% (0 / 1) 55.56% (5 / 9)
string.js 33.33% (13 / 39) 100% (0 / 0) 0% (0 / 8) 33.33% (13 / 39)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/binary.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/binary.js

Statements: 62.5% (5 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121 1 1   1           1  
var newEncode = require('./binary/newEncode');
var newDecode = require('./newDecodeCore');
var purify = require('./binary/purify');
 
function _new(column) {
	column.purify = purify;
	column.encode = newEncode(column);
	column.decode = newDecode(column);
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/boolean.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/boolean.js

Statements: 55.56% (5 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 55.56% (5 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131 1 1   1             1  
var newEncode = require('./boolean/newEncode');
var newDecode = require('./boolean/newDecode');
var purify = require('./boolean/purify');
 
function _new(column) {
	column.purify = purify;
	column.default = false;
	column.encode = newEncode(column);
	column.decode = newDecode(column);
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date.js

Statements: 62.5% (5 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121 1 1   1           1  
var newEncode = require('./date/newEncode');
var newDecode = require('./date/newDecode');
var purify = require('./date/purify');
 
function _new(column) {
	column.purify = purify;
	column.encode = newEncode(column);
	column.decode = newDecode(column);
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/encodeFilterArg.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/encodeFilterArg.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 91             1  
function encodeFilterArg (column, arg) {
	if (column.encode.safe)
		return column.encode.safe(arg);
	else
		return column.encode(arg);
}
 
module.exports = encodeFilterArg;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/equal.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/equal.js

Statements: 41.67% (5 / 12)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 41.67% (5 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161 1 1   1                   1  
var newBoolean = require('./newBoolean');
var nullOperator = ' is ';
var encodeFilterArg = require('./encodeFilterArg');
 
function equal(column,arg,alias) {	
	var operator = '=';
	var encoded = encodeFilterArg(column, arg);
	if (encoded.sql() == 'null') 
		operator = nullOperator;
	var firstPart = alias + '.' + column._dbName + operator;
	var filter =  encoded.prepend(firstPart);		
	return newBoolean(filter);
}
 
module.exports = equal;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/extractAlias.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/extractAlias.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 81           1  
function extract(table, optionalAlias) {
	if (optionalAlias)
		return optionalAlias;
	return table._dbName;
}
 
module.exports = extract;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/greaterThan.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/greaterThan.js

Statements: 44.44% (4 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 44.44% (4 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131 1   1               1  
var newBoolean = require('./newBoolean');
var encodeFilterArg = require('./encodeFilterArg');
 
function greaterThan(column,arg,alias) {	
	var operator = '>';
	var encoded = encodeFilterArg(column, arg);
	var firstPart = alias + '.' + column._dbName + operator;	
	var filter =  encoded.prepend(firstPart);		
	return newBoolean(filter);
}
 
module.exports = greaterThan;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/greaterThanOrEqual.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/greaterThanOrEqual.js

Statements: 44.44% (4 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 44.44% (4 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131 1   1               1  
var newBoolean = require('./newBoolean');
var encodeFilterArg = require('./encodeFilterArg');
 
function greaterThanOrEqual(column,arg,alias) {	
	var operator = '>=';
	var encoded = encodeFilterArg(column, arg);
	var firstPart = alias + '.' + column._dbName + operator;
	var filter =  encoded.prepend(firstPart);		
	return newBoolean(filter);
}
 
module.exports = greaterThanOrEqual;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/guid.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/guid.js

Statements: 62.5% (5 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121 1 1   1           1  
var newEncode = require('./guid/newEncode');
var newDecode = require('./newDecodeCore');
var purify = require('./guid/purify');
 
function _new(column) {
	column.purify = purify;
	column.encode = newEncode(column);
	column.decode = newDecode(column);
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/in.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/in.js

Statements: 27.78% (5 / 18)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 27.78% (5 / 18)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251 1 1   1                                     1  
var newParameterized = require('../query/newParameterized');
var newBoolean = require('./newBoolean');
var encodeFilterArg = require('./encodeFilterArg');
 
function _in(column,values,alias) {
	var filter;
	if (values.length === 0) {
		filter =  newParameterized('1=2');
		return newBoolean(filter);
	}
	var firstPart = alias + '.' + column._dbName + ' in '; 
	var parameterized = newParameterized(firstPart);	
	var separator = '(';
 
	for (var i = 0; i < values.length; i++) {
		var encoded = encodeFilterArg(column, values[i]);
		parameterized = parameterized.append(separator).append(encoded);
		separator = ',';		
	}
	filter =  parameterized.append(')');
	return newBoolean(filter);
}
 
module.exports = _in;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/json.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/json.js

Statements: 62.5% (5 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121 1 1   1           1  
var newEncode = require('./json/newEncode');
var newDecode = require('./newDecodeCore');
var purify = require('./json/purify');
 
function _new(column) {
	column.purify = purify;
	column.encode = newEncode(column);
	column.decode = newDecode(column);
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/lessThan.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/lessThan.js

Statements: 44.44% (4 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 44.44% (4 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131 1   1               1  
var newBoolean = require('./newBoolean');
var encodeFilterArg = require('./encodeFilterArg');
 
function lessThanOrEqual(column,arg,alias) {	
	var operator = '<';
	var encoded = encodeFilterArg(column, arg);
	var firstPart = alias + '.' + column._dbName + operator;
	var filter = encoded.prepend(firstPart);		
	return newBoolean(filter);
}
 
module.exports = lessThanOrEqual;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/lessThanOrEqual.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/lessThanOrEqual.js

Statements: 44.44% (4 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 44.44% (4 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131 1   1               1  
var newBoolean = require('./newBoolean');
var encodeFilterArg = require('./encodeFilterArg');
 
function lessThanOrEqual(column,arg,alias) {	
	var operator = '<=';
	var encoded = encodeFilterArg(column, arg);
	var firstPart = alias + '.' + column._dbName + operator;
	var filter = encoded.prepend(firstPart);		
	return newBoolean(filter);
}
 
module.exports = lessThanOrEqual;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextAndFilter.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextAndFilter.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 81           1  
function negotiateNextAndFilter(filter, other) {		
	if (!other.sql())
		return filter;
	return filter.append(' AND ').append(other);
}
 
module.exports = negotiateNextAndFilter;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextOrFilter.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextOrFilter.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 81           1  
function negotiateNextOrFilter(filter, other) {
	if (!other.sql())
		return filter;
	return filter.prepend('(').append(' OR ').append(other).append(')');
}
 
module.exports = negotiateNextOrFilter;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateRawSqlFilter.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateRawSqlFilter.js

Statements: 19.05% (4 / 21)      Branches: 0% (0 / 8)      Functions: 0% (0 / 3)      Lines: 19.05% (4 / 21)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 341         1         1                                           1  
var newParameterized = function() {
    newParameterized = require('../query/newParameterized');
    return newParameterized.apply(null, arguments);
};
 
var newBoolean = function() {
    newBoolean = require('./newBoolean');
    return newBoolean.apply(null, arguments);
};
 
function negotiateRawSqlFilter(filter) {
    var params = [];
    if (filter) {
        if (filter.and)
            return filter;
        if (filter.sql) {
            var sql = filter.sql;
            if (typeof filter.sql == 'function') {                
                sql = filter.sql();
            }
            params.push(sql, filter.parameters);
        }
        else
            params = [filter];
    } else {
        params = [filter];
    }
 
    var parameterized = newParameterized.apply(null, params);
    return newBoolean(parameterized);
}
 
module.exports = negotiateRawSqlFilter;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newBoolean.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newBoolean.js

Statements: 19.44% (7 / 36)      Branches: 100% (0 / 0)      Functions: 0% (0 / 7)      Lines: 19.44% (7 / 36)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 561 1 1 1   1                                                                                     1         1    
var nextNewBoolean = _nextNewBoolean;
var negotiateRawSqlFilter = require('./negotiateRawSqlFilter');
var negotiateNextAndFilter = require('./negotiateNextAndFilter');
var negotiateNextOrFilter = require('./negotiateNextOrFilter');
 
function newBoolean(filter) {
    var c = {};
    c.sql = filter.sql.bind(filter);
    c.parameters = filter.parameters;
 
    c.append = function(other) {
        var nextFilter = filter.append(other);
        return nextNewBoolean(nextFilter);
    };
 
    c.prepend = function(other) {
        var nextFilter = filter.prepend(other);
        return nextNewBoolean(nextFilter);
    };
 
    c.and = function(other) {
        other = negotiateRawSqlFilter(other);
        var nextFilter = negotiateNextAndFilter(filter, other);
        var next = nextNewBoolean(nextFilter);
        for (var i = 1; i < arguments.length; i++) {
            next = next.and(arguments[i]);
        }
        return next;
    };
 
    c.or = function(other) {
        other = negotiateRawSqlFilter(other);
        var nextFilter = negotiateNextOrFilter(filter, other);
        var next = nextNewBoolean(nextFilter);
        for (var i = 1; i < arguments.length; i++) {
            next = next.or(arguments[i]);
        }
        return next;
    };
 
    c.not = function() {
        var nextFilter = filter.prepend('NOT (').append(')');
        return nextNewBoolean(nextFilter);
    };
 
    return c;
}
 
function _nextNewBoolean(filter) {
    nextNewBoolean = require('./newBoolean');
    return nextNewBoolean(filter);
}
 
module.exports = newBoolean;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newColumn.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newColumn.js

Statements: 16.36% (9 / 55)      Branches: 100% (0 / 0)      Functions: 0% (0 / 9)      Lines: 16.36% (9 / 55)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 751 1 1 1 1 1 1 1   1                                                                                                                                  
var equal = require('./equal');
var notEqual = require('./notEqual');
var lessThan = require('./lessThan');
var lessThanOrEqual = require('./lessThanOrEqual');
var greaterThan = require('./greaterThan');
var greaterThanOrEqual = require('./greaterThanOrEqual');
var _in = require('./in');
var _extractAlias = require('./extractAlias');
 
module.exports = function(table,name) {	
	var c = {};
	var extractAlias = _extractAlias.bind(null,table);
	c._dbName = name;
	c.alias = name;	
	c.dbNull = null;	
	table._columns.push(c);
	table[name] = c;
	
	c.equal = function(arg,alias) {
		alias = extractAlias(alias);
		return equal(c,arg, alias);
	};
 
	c.notEqual = function(arg,alias) {
		alias = extractAlias(alias);
		return notEqual(c,arg,alias);
	};
 
	c.lessThan = function(arg,alias) {
		alias = extractAlias(alias);
		return lessThan(c,arg,alias);
	};
 
	c.lessThanOrEqual = function(arg,alias) {
		alias = extractAlias(alias);
		return lessThanOrEqual(c,arg,alias);
	};
 
	c.greaterThan = function(arg,alias) {
		alias = extractAlias(alias);
		return greaterThan(c,arg,alias);
	};
 
	c.greaterThanOrEqual = function(arg,alias) {
		alias = extractAlias(alias);
		return greaterThanOrEqual(c,arg,alias);
	};
 
	c.between = function(from,to,alias) {
		alias = extractAlias(alias);
		from = c.greaterThanOrEqual(from,alias);
		to = c.lessThanOrEqual(to,alias);
		return from.and(to);
	};
 
	c.in = function(arg,alias) {
		alias = extractAlias(alias);
		return _in(c,arg,alias);
	};
 
	c.eq = c.equal;
	c.EQ = c.eq;
	c.ne = c.notEqual;
	c.NE = c.ne;
	c.gt = c.greaterThan;
	c.GT = c.gt;
	c.ge = c.greaterThanOrEqual;
	c.GE = c.ge;
	c.lt = c.lessThan;
	c.LT = c.lt;
	c.le = c.lessThanOrEqual;
	c.LE = c.le;
	return c;
};
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newDecodeCore.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newDecodeCore.js

Statements: 33.33% (2 / 6)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 33.33% (2 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111                 1  
function _new(column) {
 
	return function(value) {
		if (value == column.dbNull)
			return null;
		return value;
	};
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newEncodeSafe.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newEncodeSafe.js

Statements: 30% (3 / 10)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 30% (3 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171   1                         1  
var newPara = require('../query/newParameterized');
 
function _newSafe(column, purify) {
 
	return function(value) {
		value = purify(value);
		if (value == null) {
			if (column.dbNull === null)
				return newPara('null');
			return newPara('\'' + column.dbNull + '\'');
		}
		return newPara('?', [value]);
	};
}
 
module.exports = _newSafe;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/notEqual.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/notEqual.js

Statements: 41.67% (5 / 12)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 41.67% (5 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161 1 1   1                   1  
var newBoolean = require('./newBoolean');
var encodeFilterArg = require('./encodeFilterArg');
var nullOperator = ' is not ';
 
function notEqual(column,arg,alias) {	
	var operator = '<>';
	var encoded = encodeFilterArg(column, arg);
	if (encoded.sql() == 'null') 
		operator = nullOperator;
	var firstPart = alias + '.' + column._dbName + operator;
	var filter =  encoded.prepend(firstPart);		
	return newBoolean(filter);
}
 
module.exports = notEqual;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numeric.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numeric.js

Statements: 55.56% (5 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 55.56% (5 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131 1 1   1             1  
var newEncode = require('./numeric/newEncode');
var newDecode = require('./numeric/newDecode');
var purify = require('./numeric/purify');
 
function _new(column) {
	column.default = 0;
	column.purify = purify;
	column.encode = newEncode(column);
	column.decode = newDecode(column);
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string.js

Statements: 33.33% (13 / 39)      Branches: 100% (0 / 0)      Functions: 0% (0 / 8)      Lines: 33.33% (13 / 39)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 541 1 1 1 1 1 1 1 1 1 1   1                                                                             1    
var newEncode = require('./string/newEncode');
var newDecode = require('./newDecodeCore');
var startsWith = require('./string/startsWith');
var endsWith = require('./string/endsWith');
var contains = require('./string/contains');
var iStartsWith = require('./string/iStartsWith');
var iEndsWith = require('./string/iEndsWith');
var iContains = require('./string/iContains');
var iEqual = require('./string/iEqual');
var purify = require('./string/purify');
var _extractAlias = require('./extractAlias');
 
function _new(table, column) {
    column.purify = purify;
    column.encode = newEncode(column);
    column.decode = newDecode(column);
    var extractAlias = _extractAlias.bind(null, table);
 
    column.startsWith = function(arg, alias) {
        alias = extractAlias(alias);
        return startsWith(column, arg, alias);
    };
    column.endsWith = function(arg, alias) {
        alias = extractAlias(alias);
        return endsWith(column, arg, alias);
    };
    column.contains = function(arg, alias) {
        alias = extractAlias(alias);
        return contains(column, arg, alias);
    };
    column.iStartsWith = function(arg, alias) {
        alias = extractAlias(alias);
        return iStartsWith(column, arg, alias);
    };
    column.iEndsWith = function(arg, alias) {
        alias = extractAlias(alias);
        return iEndsWith(column, arg, alias);
    };
    column.iContains = function(arg, alias) {
        alias = extractAlias(alias);
        return iContains(column, arg, alias);
    };
 
    column.iEqual = function(arg, alias) {
        alias = extractAlias(alias);
        return iEqual(column, arg, alias);
    };
 
    column.iEq = column.iEqual;
}
 
module.exports = _new;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/binary/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/binary/

Statements: 41.18% (7 / 17)      Branches: 0% (0 / 6)      Functions: 0% (0 / 3)      Lines: 41.18% (7 / 17)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/binary/
File Statements Branches Functions Lines
newEncode.js 50% (5 / 10) 0% (0 / 2) 0% (0 / 2) 50% (5 / 10)
purify.js 28.57% (2 / 7) 0% (0 / 4) 0% (0 / 1) 28.57% (2 / 7)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/binary/newEncode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/binary/newEncode.js

Statements: 50% (5 / 10)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 50% (5 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1   1       1               1  
var purify = require('./purify');
var newParam = require('../../query/newParameterized');
 
function _new(column) {
	
	return encode;
 
	function encode(value) {
		value = purify(value);
		if (value === null)
		 	return newParam('null');
		return newParam('?', [value]);				
	}
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/binary/purify.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/binary/purify.js

Statements: 28.57% (2 / 7)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 28.57% (2 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 101               1  
function purify(value) {		
	if(value == null)
		return null;
	if (!Buffer.isBuffer(value))
		throw new Error('\'' + value + '\'' + ' is not a buffer');
	return value;
}
 
module.exports = purify;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/binarySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/binarySpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/binarySpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/binarySpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/binarySpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
.it('should set purify').assertEqual(c.purify, c.column.purify)
.it('should set encode').assertEqual(c.encode, c.column.encode)
.it('should set decode').assertEqual(c.decode, c.column.decode);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/boolean/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/boolean/

Statements: 40% (12 / 30)      Branches: 0% (0 / 12)      Functions: 0% (0 / 5)      Lines: 40% (12 / 30)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/boolean/
File Statements Branches Functions Lines
newDecode.js 42.86% (3 / 7) 0% (0 / 2) 0% (0 / 2) 42.86% (3 / 7)
newEncode.js 38.89% (7 / 18) 0% (0 / 6) 0% (0 / 2) 38.89% (7 / 18)
purify.js 40% (2 / 5) 0% (0 / 4) 0% (0 / 1) 40% (2 / 5)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/boolean/newDecode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/boolean/newDecode.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131   1                 1  
var purify = require('./purify');
 
function _new(column) {
 
	return function(value) {
		if (value == column.dbNull)
			return null;
		return purify(value);
	};
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/boolean/newEncode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/boolean/newEncode.js

Statements: 38.89% (7 / 18)      Branches: 0% (0 / 6)      Functions: 0% (0 / 2)      Lines: 38.89% (7 / 18)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 281 1 1 1   1     1                                   1  
var purify = require('./purify');
var newParam = require('../../query/newParameterized');
var getSessionSingleton = require('../../getSessionSingleton');
var newEncodeSafe = require('../newEncodeSafe');
 
function _new(column) {
	
 
	function encode(value) {
		value = purify(value);
		if (value === null) {
			if (column.dbNull === null)
				return newParam('null');
			return newParam('\'' + column.dbNull + '\'');
		}
		var encodeCore =  getSessionSingleton('encodeBoolean');
 
		if (value)
			return newParam(encodeCore(true));	
		return newParam(encodeCore(false));	
	}
 
	encode.safe = newEncodeSafe(column, purify);
	return encode;
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/boolean/purify.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/boolean/purify.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 81           1  
function purify(value) {		
	if (value === null || typeof (value) == 'undefined')
		return null;
	return Boolean(value);
}
 
module.exports = purify;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/booleanSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/booleanSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/booleanSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/booleanSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/booleanSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 102                  
var when = require('a').when;
var c = {};
 
when(c)
.it('should set purify').assertEqual(c.purify, c.column.purify)
.it('sets default to false').assertStrictEqual(false, c.column.default)
.it('should set encode').assertEqual(c.encode, c.column.encode)
.it('should set decode').assertEqual(c.decode, c.column.decode);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/

Statements: 42.19% (27 / 64)      Branches: 0% (0 / 20)      Functions: 0% (0 / 12)      Lines: 42.19% (27 / 64)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/date/
File Statements Branches Functions Lines
cloneDate.js 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 2) 42.86% (3 / 7)
getISOTimezone.js 42.86% (3 / 7) 0% (0 / 4) 0% (0 / 2) 42.86% (3 / 7)
newDecode.js 40% (4 / 10) 0% (0 / 2) 0% (0 / 2) 40% (4 / 10)
newEncode.js 37.5% (6 / 16) 0% (0 / 4) 0% (0 / 2) 37.5% (6 / 16)
purify.js 33.33% (4 / 12) 0% (0 / 6) 0% (0 / 1) 33.33% (4 / 12)
toISOString.js 57.14% (4 / 7) 0% (0 / 2) 0% (0 / 2) 57.14% (4 / 7)
tryParseISO.js 60% (3 / 5) 0% (0 / 2) 0% (0 / 1) 60% (3 / 5)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/cloneDate.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/cloneDate.js

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191   1                           1    
var toISOString = require('./toISOString');
 
function cloneDate(date) {
    date = new Date(date);
 
    Object.defineProperty(date, 'toISOString', {
        enumerable: false,
        configurable: true,
        writable: true,
        value: function() {
            return toISOString(date);
        }
    });
    return date;
}
 
module.exports = cloneDate;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/getISOTimezone.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/getISOTimezone.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151             1         1    
function getISOTimezone() {
    var now = new Date(),
        tzo = -now.getTimezoneOffset(),
        dif = tzo >= 0 ? '+' : '-';
    	return dif + pad(tzo / 60) + ':' + pad(tzo % 60);
}
 
function pad(num) {
    var norm = Math.abs(Math.floor(num));
    return (norm < 10 ? '0' : '') + norm;
}
 
module.exports = getISOTimezone;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/newDecode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/newDecode.js

Statements: 40% (4 / 10)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 40% (4 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161 1   1                     1  
var newDecodeCore = require('../newDecodeCore');
var cloneDate = require('./cloneDate');
 
function _new(column) {	
	var decodeCore = newDecodeCore(column);	
	
	return function(value) {
		value = decodeCore(value);
		if (value === null)
			return value;
		return cloneDate(value);
	};
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/newEncode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/newEncode.js

Statements: 37.5% (6 / 16)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 37.5% (6 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251 1 1 1   1                                 1    
var newPara = require('../../query/newParameterized');
var purify = require('./purify');
var newEncodeSafe = require('../newEncodeSafe');
var getSessionSingleton = require('../../getSessionSingleton');
 
function _new(column) {
    var encode = function(value) {
        value = purify(value);
        if (value == null) {
            if (column.dbNull === null)
                return newPara('null');
            return newPara('\'' + column.dbNull + '\'');
        }
        var encodeCore = getSessionSingleton('encodeDate');
        return newPara(encodeCore(value));
    };
 
    encode.safe = newEncodeSafe(column, purify);
    return encode;
 
}
 
module.exports = _new;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/purify.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/purify.js

Statements: 33.33% (4 / 12)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 33.33% (4 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191 1   1                           1  
var tryParseISO = require('./tryParseISO');
var cloneDate = require('./cloneDate');
 
function purify(value) {			
	if(value == null)
		return null;	
 
	if (value.toISOString) 
		return cloneDate(value);
 
	var iso = tryParseISO(value);
	if (iso)
		return iso;	
	
	return cloneDate(value);
}
 
module.exports = purify;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/toISOString.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/toISOString.js

Statements: 57.14% (4 / 7)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 57.14% (4 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221   1                     1             1  
var getISOTimezone = require('./getISOTimezone');
 
function toISOString(date) {
	return date.getFullYear() +
         '-' + pad(date.getMonth()+1) +
         '-' + pad(date.getDate()) +
         'T' + pad(date.getHours()) +
         ':' + pad(date.getMinutes()) +
         ':' + pad(date.getSeconds()) +
         '.' + pad(date.getMilliseconds()) +
         getISOTimezone();
}
 
function pad(num) {
	var norm = Math.abs(Math.floor(num));
    return (norm < 10 ? '0' : '') + norm;
}
 
 
 
module.exports = toISOString;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/tryParseISO.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/date/tryParseISO.js

Statements: 60% (3 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 91   1         1  
var pattern = /(\d{4}-[01]\d-[0-3]\d(T| )[0-2]\d:[0-5]\d:[0-5]\d\.\d+)|(\d{4}-[01]\d-[0-3]\d(T| )[0-2]\d:[0-5]\d:[0-5]\d)|(\d{4}-[01]\d-[0-3]\d(T| )[0-2]\d:[0-5]\d)/
 
function tryParseISO (iso) {
	if (pattern.test(iso))
		return iso;
}
 
module.exports = tryParseISO;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/dateSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/dateSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/dateSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/dateSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/dateSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
.it('should set purify').assertEqual(c.purify, c.column.purify)
.it('should set encode').assertEqual(c.encode, c.column.encode)
.it('should set decode').assertEqual(c.decode, c.column.decode);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/encodeFilterArgSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/encodeFilterArgSpec/

Statements: 16.67% (2 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/encodeFilterArgSpec/
File Statements Branches Functions Lines
req.js 16.67% (2 / 12) 100% (0 / 0) 0% (0 / 1) 16.67% (2 / 12)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/encodeFilterArgSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/encodeFilterArgSpec/req.js

Statements: 16.67% (2 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 182   1                              
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.expected = {};
	c.column = {};
	c.arg = {};
	c.column.encode = c.mock();
 
	c.sut = require('../encodeFilterArg');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/equalSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/equalSpec/

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/equalSpec/
File Statements Branches Functions Lines
req.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/equalSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/equalSpec/req.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 142     1                    
var amock = require('a');
var requireMock = amock.requireMock;
 
function act(c) {
	c.newBoolean = requireMock('./newBoolean');
	c.encodeFilterArg = requireMock('./encodeFilterArg');
	c.mock = amock.mock;
	c.column = {};
	c.column._dbName = 'columnName';
	c.sut = require('../equal');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/greaterThanOrEqualSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/greaterThanOrEqualSpec/

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/greaterThanOrEqualSpec/
File Statements Branches Functions Lines
req.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/greaterThanOrEqualSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/greaterThanOrEqualSpec/req.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 152     1                      
var amock = require('a');
var requireMock = amock.requireMock;
 
function act(c) {
	c.newBoolean = requireMock('./newBoolean');
	c.encodeFilterArg = requireMock('./encodeFilterArg');
 
	c.mock = amock.mock;
	c.column = {};
	c.column._dbName = 'columnName';
	c.sut = require('../greaterThanOrEqual');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/greaterThanSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/greaterThanSpec/

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/greaterThanSpec/
File Statements Branches Functions Lines
req.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/greaterThanSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/greaterThanSpec/req.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 162     1                        
var a = require('a');
var requireMock = a.requireMock;
 
function act(c) {
    c.newBoolean = requireMock('./newBoolean');
    c.encodeFilterArg = requireMock('./encodeFilterArg');
 
    c.mock = a.mock;
    c.column = {};
    c.column._dbName = 'columnName';
    c.sut = require('../greaterThan');
}
 
module.exports = act;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/guid/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/guid/

Statements: 31.58% (6 / 19)      Branches: 0% (0 / 8)      Functions: 0% (0 / 3)      Lines: 31.58% (6 / 19)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/guid/
File Statements Branches Functions Lines
newEncode.js 36.36% (4 / 11) 0% (0 / 4) 0% (0 / 2) 36.36% (4 / 11)
purify.js 25% (2 / 8) 0% (0 / 4) 0% (0 / 1) 25% (2 / 8)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/guid/newEncode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/guid/newEncode.js

Statements: 36.36% (4 / 11)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 36.36% (4 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181 1   1                         1  
var newPara = require('../../query/newParameterized');
var purify = require('./purify');
 
function _new(column) {
	
	return function(candidate) {
		var value = purify(candidate);
		if (value == null) {
			if(column.dbNull === null)
				return newPara('null');
			return newPara('\'' + column.dbNull + '\'');
		}
		return newPara('\'' + value + '\'');	
	};
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/guid/purify.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/guid/purify.js

Statements: 25% (2 / 8)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111                 1  
function negotiateGuidFormat(candidate) {
	if(candidate == null)
		return null;
	var pattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
	if(!pattern.test(candidate))
		throw new TypeError(candidate +  ' is not a valid UUID');
	return candidate;
}
 
module.exports = negotiateGuidFormat;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/guidSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/guidSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/guidSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/guidSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/guidSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
.it('should set purify').assertEqual(c.purify, c.column.purify)
.it('should set encode').assertEqual(c.encode, c.column.encode)
.it('should set decode').assertEqual(c.decode, c.column.decode);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/inSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/inSpec/

Statements: 14.29% (2 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 14.29% (2 / 14)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/inSpec/
File Statements Branches Functions Lines
req.js 14.29% (2 / 14) 100% (0 / 0) 0% (0 / 1) 14.29% (2 / 14)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/inSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/inSpec/req.js

Statements: 14.29% (2 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 14.29% (2 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 202             1                        
var amock = require('a');
var requireMock = amock.requireMock;
var newParameterized = requireMock('../query/newParameterized');
var newBoolean = requireMock('./newBoolean');
var encodeFilterArg = requireMock('./encodeFilterArg');
 
 
function act(c) {
	c.newBoolean = newBoolean;
	c.newParameterized = newParameterized;
	c.encodeFilterArg = encodeFilterArg;
	c.mock = amock.mock;
	c.column = {};
	c.column._dbName = 'columnName';
	c.sut = require('../in');
}
 
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/json/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/json/

Statements: 37.5% (6 / 16)      Branches: 0% (0 / 6)      Functions: 0% (0 / 3)      Lines: 37.5% (6 / 16)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/json/
File Statements Branches Functions Lines
newEncode.js 36.36% (4 / 11) 0% (0 / 4) 0% (0 / 2) 36.36% (4 / 11)
purify.js 40% (2 / 5) 0% (0 / 2) 0% (0 / 1) 40% (2 / 5)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/json/newEncode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/json/newEncode.js

Statements: 36.36% (4 / 11)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 36.36% (4 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181 1   1                         1  
var newPara = require('../../query/newParameterized');
var purify = require('./purify');
 
function _new(column) {
	
	return function(candidate) {
		var value = purify(candidate);
		if (value == null) {
			if(column.dbNull === null)
				return newPara('null');
			return newPara('\'' + column.dbNull + '\'');
		}
		return newPara('?', [JSON.stringify(value)]);	
	};
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/json/purify.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/json/purify.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 81           1  
function purify(value) {
	if(value == null)
		return null;
	return value;
}
 
module.exports = purify;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/jsonSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/jsonSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/jsonSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/jsonSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/jsonSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
.it('should set purify').assertEqual(c.purify, c.column.purify)
.it('should set encode').assertEqual(c.encode, c.column.encode)
.it('should set decode').assertEqual(c.decode, c.column.decode);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/lessThanOrEqualSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/lessThanOrEqualSpec/

Statements: 16.67% (2 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/lessThanOrEqualSpec/
File Statements Branches Functions Lines
req.js 16.67% (2 / 12) 100% (0 / 0) 0% (0 / 1) 16.67% (2 / 12)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/lessThanOrEqualSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/lessThanOrEqualSpec/req.js

Statements: 16.67% (2 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 162         1                    
var amock = require('a');
var requireMock = amock.requireMock;
var newBoolean = requireMock('./newBoolean');
var encodeFilterArg = requireMock('./encodeFilterArg');
 
function act(c) {
	c.newBoolean = newBoolean;
	c.encodeFilterArg = encodeFilterArg;
	c.mock = amock.mock;
	c.column = {};
	c.column._dbName = 'columnName';
	c.sut = require('../lessThanOrEqual');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/lessThanSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/lessThanSpec/

Statements: 16.67% (2 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/lessThanSpec/
File Statements Branches Functions Lines
req.js 16.67% (2 / 12) 100% (0 / 0) 0% (0 / 1) 16.67% (2 / 12)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/lessThanSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/lessThanSpec/req.js

Statements: 16.67% (2 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 162         1                    
var a = require('a');
var requireMock = a.requireMock;
var newBoolean = requireMock('./newBoolean');
var encodeFilterArg = requireMock('./encodeFilterArg');
 
function act(c) {
	c.newBoolean = newBoolean;
	c.encodeFilterArg = encodeFilterArg;
	c.mock = a.mock;
	c.column = {};
	c.column._dbName = 'columnName';
	c.sut = require('../lessThan');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextAndFilterSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextAndFilterSpec/

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextAndFilterSpec/
File Statements Branches Functions Lines
req.js 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextAndFilterSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextAndFilterSpec/req.js

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 172   1                            
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.filter = {};
	c.filter2 = {};
	c.filter2.sql = c.mock();
 
	c.sut = require('../negotiateNextAndFilter');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextOrFilterSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextOrFilterSpec/

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextOrFilterSpec/
File Statements Branches Functions Lines
req.js 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextOrFilterSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateNextOrFilterSpec/req.js

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 172   1                            
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.filter = {};
	c.filter2 = {};
	c.filter2.sql = c.mock();
 
	c.sut = require('../negotiateNextOrFilter');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateRawSqlFilterSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateRawSqlFilterSpec/

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/negotiateRawSqlFilterSpec/
File Statements Branches Functions Lines
req.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateRawSqlFilterSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/negotiateRawSqlFilterSpec/req.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 172   1                            
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.sut = require('../negotiateRawSqlFilter');
 
	c.newParameterized = c.requireMock('../query/newParameterized');
	c.newBoolean = c.requireMock('./newBoolean');
	
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newBooleanSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newBooleanSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/newBooleanSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newBooleanSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newBooleanSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should set sql to filter.sql').assertEqual(c.sql, c.sut.sql())
	.it('should set parameters to filter.parameters').assertEqual(c.filter.parameters, c.sut.parameters)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newColumnSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newColumnSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/newColumnSpec/
File Statements Branches Functions Lines
when_new.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newColumnSpec/when_new.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/newColumnSpec/when_new.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 242                                              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should add column to table._columns').assertEqual(c.sut,c.columns[0])
	.it('should not add any other columns').assertEqual(1,c.columns.length)
	.it('should set dbName to name').assertEqual(c.name,c.sut._dbName)
	.it('should set alias to name').assertEqual(c.name,c.sut.alias)
	.it('should set dbNull to null').assertStrictEqual(null, c.sut.dbNull)	
	.it('eq is alias for equal').assertDeepEqual(c.sut.equal,c.sut.eq)
	.it('EQ is alias for equal').assertEqual(c.sut.equal,c.sut.EQ)
	.it('ne is alias for notEqual').assertEqual(c.sut.notEqual,c.sut.ne)
	.it('NE is alias for notEqual').assertEqual(c.sut.notEqual,c.sut.NE)
	.it('gt is alias for greaterThan').assertEqual(c.sut.greaterThan,c.sut.gt)
	.it('GT is alias for greaterThan').assertEqual(c.sut.greaterThan,c.sut.GT)
	.it('ge is alias for greaterThanOrEqual').assertEqual(c.sut.greaterThanOrEqual,c.sut.ge)
	.it('GE is alias for greaterThanOrEqual').assertEqual(c.sut.greaterThanOrEqual,c.sut.GE)
	.it('lt is alias for lessThan').assertEqual(c.sut.lessThan,c.sut.lt)
	.it('LT is alias for lessThan').assertEqual(c.sut.lessThan,c.sut.LT)
	.it('le is alias for lessThanOrEqual').assertEqual(c.sut.lessThanOrEqual,c.sut.le)
	.it('LE is alias for lessThanOrEqual').assertEqual(c.sut.lessThanOrEqual,c.sut.LE)
	.it('should set table.<columnName> to column').assertEqual(c.table.columnName,c.sut);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/notEqualSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/notEqualSpec/

Statements: 14.29% (2 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 14.29% (2 / 14)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/notEqualSpec/
File Statements Branches Functions Lines
req.js 14.29% (2 / 14) 100% (0 / 0) 0% (0 / 1) 14.29% (2 / 14)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/notEqualSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/notEqualSpec/req.js

Statements: 14.29% (2 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 14.29% (2 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 182           1                      
var amock = require('a');
var requireMock = amock.requireMock;
var newBoolean = requireMock('./newBoolean');
var encodeFilterArg = requireMock('./encodeFilterArg');
var alias = '_2';
 
function act(c) {
	c.alias = alias;
	c.newBoolean = newBoolean;
	c.encodeFilterArg = encodeFilterArg;
	c.mock = amock.mock;
	c.column = {};
	c.column._dbName = 'columnName';
	c.sut = require('../notEqual');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numeric/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numeric/

Statements: 32.26% (10 / 31)      Branches: 0% (0 / 12)      Functions: 0% (0 / 6)      Lines: 32.26% (10 / 31)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/numeric/
File Statements Branches Functions Lines
negotiateDefault.js 33.33% (1 / 3) 0% (0 / 2) 0% (0 / 1) 33.33% (1 / 3)
newDecode.js 27.27% (3 / 11) 0% (0 / 4) 0% (0 / 2) 27.27% (3 / 11)
newEncode.js 40% (4 / 10) 0% (0 / 2) 0% (0 / 2) 40% (4 / 10)
purify.js 28.57% (2 / 7) 0% (0 / 4) 0% (0 / 1) 28.57% (2 / 7)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numeric/negotiateDefault.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numeric/negotiateDefault.js

Statements: 33.33% (1 / 3)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6  1        
 
module.exports = function(column) {
	if(!column.hasOwnProperty('default'))
		column.default = 0;
};
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numeric/newDecode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numeric/newDecode.js

Statements: 27.27% (3 / 11)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 27.27% (3 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171   1                         1  
var newDecodeCore = require('../newDecodeCore');
 
function _new(column) {	
	var decodeCore = newDecodeCore(column);	
	
	return function(value) {
		value = decodeCore(value);
		if (value === null)
			return value;
		if (typeof(value) != 'number')
			return parseFloat(value);
		return value;
	};
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numeric/newEncode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numeric/newEncode.js

Statements: 40% (4 / 10)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 40% (4 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161 1   1     1                  
var purify = require('./purify');
var newParam = require('../../query/newParameterized');
 
module.exports = function(column) {
	return encode;
 
	function encode(value) {
		value = purify(value);
		if (value == null) {
			var dbNull = column.dbNull;
			return newParam('' + dbNull + '');
		}
		return newParam('' + value);
	}
};
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numeric/purify.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numeric/purify.js

Statements: 28.57% (2 / 7)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 28.57% (2 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 101               1  
function purify(value) {		
	if(value == null)
		return null;
	if (typeof(value) != 'number')
		throw new Error('\'' + value + '\'' + ' is not a number');
	return value;
}
 
module.exports = purify;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numericSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numericSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/numericSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numericSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/numericSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 102                  
var when = require('a').when;
var c = {};
 
when(c)
.it('should set purify').assertEqual(c.purify, c.column.purify)
.it('sets default to zero').assertEqual(0, c.column.default)
.it('should set encode').assertEqual(c.encode, c.column.encode)
.it('should set decode').assertEqual(c.decode, c.column.decode);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/

Statements: 50.98% (52 / 102)      Branches: 0% (0 / 20)      Functions: 0% (0 / 9)      Lines: 50.98% (52 / 102)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/string/
File Statements Branches Functions Lines
contains.js 100% (2 / 2) 100% (0 / 0) 100% (0 / 0) 100% (2 / 2)
containsCore.js 33.33% (4 / 12) 0% (0 / 2) 0% (0 / 1) 33.33% (4 / 12)
encodeCore.js 45.45% (5 / 11) 0% (0 / 4) 0% (0 / 1) 45.45% (5 / 11)
endsWith.js 100% (2 / 2) 100% (0 / 0) 100% (0 / 0) 100% (2 / 2)
endsWithCore.js 33.33% (4 / 12) 0% (0 / 2) 0% (0 / 1) 33.33% (4 / 12)
iContains.js 100% (2 / 2) 100% (0 / 0) 100% (0 / 0) 100% (2 / 2)
iEndsWith.js 100% (2 / 2) 100% (0 / 0) 100% (0 / 0) 100% (2 / 2)
iEqual.js 41.67% (5 / 12) 0% (0 / 2) 0% (0 / 1) 41.67% (5 / 12)
iStartsWith.js 100% (2 / 2) 100% (0 / 0) 100% (0 / 0) 100% (2 / 2)
newEncode.js 35.71% (5 / 14) 0% (0 / 6) 0% (0 / 2) 35.71% (5 / 14)
purify.js 40% (2 / 5) 0% (0 / 2) 0% (0 / 1) 40% (2 / 5)
startsWith.js 100% (2 / 2) 100% (0 / 0) 100% (0 / 0) 100% (2 / 2)
startsWithCore.js 33.33% (4 / 12) 0% (0 / 2) 0% (0 / 1) 33.33% (4 / 12)
stringIsSafe.js 91.67% (11 / 12) 100% (0 / 0) 0% (0 / 1) 91.67% (11 / 12)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/contains.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/contains.js

Statements: 100% (2 / 2)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (2 / 2)      Ignored: none     

1 2 3 4 51   1    
var containsCore = require('./containsCore');
 
module.exports = containsCore.bind(null, 'LIKE');
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/containsCore.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/containsCore.js

Statements: 33.33% (4 / 12)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 33.33% (4 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1   1                       1  
var newBoolean = require('../newBoolean');
var nullOperator = ' is ';
 
function endsWithCore(operator, column,arg,alias) {	
	operator = ' ' + operator + ' ';
	var encoded = column.encode(arg);
	if (encoded.sql() == 'null') 
		operator = nullOperator;
	else
		encoded = column.encode('%' + arg + '%');
	var firstPart = alias + '.' + column._dbName + operator;
	var filter =  encoded.prepend(firstPart);		
	return newBoolean(filter);
}
 
module.exports = endsWithCore;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/encodeCore.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/encodeCore.js

Statements: 45.45% (5 / 11)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 45.45% (5 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1 1   1                 1  
var newPara = require('../../query/newParameterized');
var	stringIsSafe = require('./stringIsSafe');
var purify = require('./purify');
 
function _new(value,column) {
		value = purify(value);
		if (value == null)
			return newPara('' + column.dbNull + '');
		if(stringIsSafe(value))
			return newPara('' + value + '');
		return newPara('?', [value]);
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/endsWith.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/endsWith.js

Statements: 100% (2 / 2)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (2 / 2)      Ignored: none     

1 2 3 4 51   1    
var endsWithCore = require('./endsWithCore');
 
module.exports = endsWithCore.bind(null, 'LIKE');
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/endsWithCore.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/endsWithCore.js

Statements: 33.33% (4 / 12)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 33.33% (4 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1   1                       1  
var newBoolean = require('../newBoolean');
var nullOperator = ' is ';
 
function endsWithCore(operator, column,arg,alias) {	
	operator = ' ' + operator + ' ';
	var encoded = column.encode(arg);
	if (encoded.sql() == 'null') 
		operator = nullOperator;
	else
		encoded = column.encode('%' + arg);
	var firstPart = alias + '.' + column._dbName + operator;
	var filter =  encoded.prepend(firstPart);		
	return newBoolean(filter);
}
 
module.exports = endsWithCore;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/iContains.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/iContains.js

Statements: 100% (2 / 2)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (2 / 2)      Ignored: none     

1 2 3 4 51   1    
var containsCore = require('./containsCore');
 
module.exports = containsCore.bind(null, 'ILIKE');
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/iEndsWith.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/iEndsWith.js

Statements: 100% (2 / 2)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (2 / 2)      Ignored: none     

1 2 3 4 51   1    
var endsWithCore = require('./endsWithCore');
 
module.exports = endsWithCore.bind(null, 'ILIKE');
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/iEqual.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/iEqual.js

Statements: 41.67% (5 / 12)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 41.67% (5 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161 1 1   1                   1  
var newBoolean = require('../newBoolean');
var nullOperator = ' is ';
var encodeFilterArg = require('../encodeFilterArg');
 
function iEqual(column,arg,alias) {	
	var operator = ' ILIKE ';
	var encoded = encodeFilterArg(column, arg);
	if (encoded.sql() == 'null') 
		operator = nullOperator;
	var firstPart = alias + '.' + column._dbName + operator;
	var filter =  encoded.prepend(firstPart);		
	return newBoolean(filter);
}
 
module.exports = iEqual;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/iStartsWith.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/iStartsWith.js

Statements: 100% (2 / 2)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (2 / 2)      Ignored: none     

1 2 3 41   1  
var startsWithCore = require('./startsWithCore');
 
module.exports = startsWithCore.bind(null, 'ILIKE');
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/newEncode.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/newEncode.js

Statements: 35.71% (5 / 14)      Branches: 0% (0 / 6)      Functions: 0% (0 / 2)      Lines: 35.71% (5 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211 1 1   1                             1  
var newPara = require('../../query/newParameterized');
var stringIsSafe = require('./stringIsSafe');
var purify = require('./purify');
 
function _new(column) {
 
	return function(value) {
		value = purify(value);
		if (value == null) {
			if (column.dbNull === null)
				return newPara('null');
			return newPara('\'' + column.dbNull + '\'');
		}
		if(stringIsSafe(value))
			return newPara('\'' + value + '\'');
		return newPara('?', [value]);
	};
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/purify.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/purify.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 81           1  
function purify(value) {
	if(value == null)
		return null;
	return value;
}
 
module.exports = purify;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/startsWith.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/startsWith.js

Statements: 100% (2 / 2)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (2 / 2)      Ignored: none     

1 2 3 41   1  
var startsWithCore = require('./startsWithCore');
 
module.exports = startsWithCore.bind(null, 'LIKE');
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/startsWithCore.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/startsWithCore.js

Statements: 33.33% (4 / 12)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 33.33% (4 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1   1                       1  
var newBoolean = require('../newBoolean');
var nullOperator = ' is ';
 
function startsWithCore(operator, column,arg,alias) {	
	operator = ' ' + operator + ' ';
	var encoded = column.encode(arg);
	if (encoded.sql() == 'null') 
		operator = nullOperator;
	else
		encoded = column.encode(arg + '%');
	var firstPart = alias + '.' + column._dbName + operator;
	var filter =  encoded.prepend(firstPart);		
	return newBoolean(filter);
}
 
module.exports = startsWithCore;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/stringIsSafe.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/string/stringIsSafe.js

Statements: 91.67% (11 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 91.67% (11 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161 1 1 1 1 1 1 1 1   1       1  
var ascii = '\u0020\u0028-\u003E\u0040-\u005A\u0060-\u007A';
var latin1 = '\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF';
var latinExtA = '\u0100-\u017F';
var latinExtB = '\u0180-\u024F';
var cyrillic = '\u0400-\u04FF';	
var cjk = '\u4E00-\u9FC3';
var util = require('util');
var patternString = util.format('^[%s%s%s%s%s%s]+$', ascii, latin1, latinExtA, latinExtB, cyrillic, cjk);
var pattern = new RegExp(patternString);
 
function stringIsSafe(value) {
	return pattern.test(value);
}
 
module.exports = stringIsSafe;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/stringSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/stringSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/column/stringSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/stringSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/column/stringSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c  = {};
 
when('./new',c)
	.it('should set purify').assertEqual(c.purify, c.column.purify)
	.it('should set encode on column').assertEqual(c.encode,c.column.encode)
	.it('should set decode on column').assertEqual(c.decode,c.column.decode)
	.it('should set iEq alias for iEqual').assertEqual(c.column.iEqual, c.column.iEq)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/

Statements: 31.15% (19 / 61)      Branches: 100% (0 / 0)      Functions: 0% (0 / 4)      Lines: 31.15% (19 / 61)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/
File Statements Branches Functions Lines
as.js 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
dbNull.js 28.57% (2 / 7) 100% (0 / 0) 0% (0 / 1) 28.57% (2 / 7)
default.js 28.57% (2 / 7) 100% (0 / 0) 0% (0 / 1) 28.57% (2 / 7)
serializable.js 40% (2 / 5) 100% (0 / 0) 0% (0 / 1) 40% (2 / 5)
whenAs.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenBinary.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenBoolean.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenDate.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenDbNull.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenDefault.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenGuid.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenJson.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenNumeric.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenSerializable.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenString.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/as.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/as.js

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 132   1                    
var requireMock = require('a').requireMock;
 
function act(c) {
	c.originalName = 'originalName';
	c.table.originalName = {};		
	c.column.alias = c.originalName;
	c.alias = 'newAlias';
	c.returned = c.sut.as(c.alias);
}
 
act.base = '../new';
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/dbNull.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/dbNull.js

Statements: 28.57% (2 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 28.57% (2 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 112     1              
var requireMock = require('a').requireMock;
var dbNull  = {};
 
function act(c) {
	c.dbNull = dbNull;
	c.returned = c.sut.dbNull(dbNull);
}
 
act.base = '../new';
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/default.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/default.js

Statements: 28.57% (2 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 28.57% (2 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 112     1              
var requireMock = require('a').requireMock;
var defaultValue  = {};
 
function act(c) {
	c.default = defaultValue;
	c.returned = c.sut.default(defaultValue);
}
 
act.base = '../new';
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/serializable.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/serializable.js

Statements: 40% (2 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 92   1            
var requireMock = require('a').requireMock;
 
function act(c) {
	c.serializable = {};
	c.returned = c.sut.serializable(c.serializable);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenAs.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenAs.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 102                  
var when = require('a').when;
var c = {};
 
when('./as',c)
	.it('should set alias on column').assertEqual(c.alias,c.column.alias)
	.it('should delete table.originalName').assertEqual(false,'originalName' in c.table)
	.it('should set table.newAlias').assertEqual(c.column,c.table.newAlias)
	.it('should return self').assertDeepEqual(c.sut,c.returned)
	;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenBinary.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenBinary.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when('./binary',c)
	.it('sets type').assertDoesNotThrow(c.binary.verify)
	.it('returns self').assertEqual(c.sut,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenBoolean.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenBoolean.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when('./boolean',c)
	.it('sets type').assertDoesNotThrow(c.bool.verify)
	.it('returns self').assertEqual(c.sut,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenDate.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenDate.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when('./date',c).
	it('sets type').assertDoesNotThrow(c.date.verify).
	it('returns self').assertEqual(c.sut,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenDbNull.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenDbNull.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when('./dbNull',c).
	it('should set dbNull on column').assertEqual(c.dbNull,c.column.dbNull).
	it('should return self').assertStrictEqual(c.sut,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenDefault.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenDefault.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when('./default',c).
	it('should set default on column').assertEqual(c.default,c.column.default).
	it('should return self').assertStrictEqual(c.sut,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenGuid.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenGuid.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when('./guid',c).
	it('sets type').assertDoesNotThrow(c.guid.verify).
	it('returns self').assertEqual(c.sut,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenJson.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenJson.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when('./json',c).
	it('sets type').assertDoesNotThrow(c.json.verify).
	it('returns self').assertEqual(c.sut,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenNumeric.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenNumeric.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when('./numeric',c).
	it('sets type').assertDoesNotThrow(c.numeric.verify).
	it('returns self').assertEqual(c.sut,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenSerializable.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenSerializable.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c).
	it('should set serializable on column').assertEqual(c.serializable,c.column.serializable).
	it('should return self').assertStrictEqual(c.sut,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenString.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/columnSpec/new/whenString.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when('./string',c).
	it('sets type').assertDoesNotThrow(c.string.verify).
	it('returns self').assertEqual(c.sut,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/

Statements: 40% (76 / 190)      Branches: 0% (0 / 20)      Functions: 0% (0 / 31)      Lines: 40% (76 / 190)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/
File Statements Branches Functions Lines
beginCommand.js 100% (6 / 6) 100% (0 / 0) 0% (0 / 1) 100% (6 / 6)
commitCommand.js 100% (6 / 6) 100% (0 / 0) 0% (0 / 1) 100% (6 / 6)
compressChanges.js 21.05% (4 / 19) 0% (0 / 6) 0% (0 / 1) 21.05% (4 / 19)
getChangeSet.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
lastCommandMatches.js 37.5% (3 / 8) 0% (0 / 4) 0% (0 / 1) 37.5% (3 / 8)
negotiateEndEdit.js 40% (2 / 5) 0% (0 / 4) 0% (0 / 1) 40% (2 / 5)
newDeleteCommand.js 26.67% (4 / 15) 100% (0 / 0) 0% (0 / 2) 26.67% (4 / 15)
newInsertCommand.js 55.56% (10 / 18) 100% (0 / 0) 0% (0 / 6) 55.56% (10 / 18)
newInsertCommandCore.js 25% (5 / 20) 0% (0 / 2) 0% (0 / 1) 25% (5 / 20)
newRow.js 26.67% (4 / 15) 0% (0 / 2) 0% (0 / 2) 26.67% (4 / 15)
newUpdateCommand.js 44.44% (12 / 27) 100% (0 / 0) 0% (0 / 8) 44.44% (12 / 27)
newUpdateCommandCore.js 18.75% (6 / 32) 0% (0 / 2) 0% (0 / 4) 18.75% (6 / 32)
pushCommand.js 55.56% (5 / 9) 100% (0 / 0) 0% (0 / 1) 55.56% (5 / 9)
rollbackCommand.js 100% (6 / 6) 100% (0 / 0) 0% (0 / 1) 100% (6 / 6)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/beginCommand.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/beginCommand.js

Statements: 100% (6 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 100% (6 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 101   1 1   1 1   1  
var newParameterized = require('../query/newParameterized');
 
var command = newParameterized('BEGIN');
function empty() {}
 
command.endEdit = empty;
command.matches = empty;
 
module.exports = command;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/commitCommand.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/commitCommand.js

Statements: 100% (6 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 100% (6 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 101   1 1   1 1   1  
var newParameterized = require('../query/newParameterized');
 
var command = newParameterized('COMMIT');
function empty() {}
 
command.endEdit = empty;
command.matches = empty;
 
module.exports = command;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChanges.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChanges.js

Statements: 21.05% (4 / 19)      Branches: 0% (0 / 6)      Functions: 0% (0 / 1)      Lines: 21.05% (4 / 19)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 271 1   1                                           1  
var newParameterized = require('../query/newParameterized');
var getSessionSingleton = require('../getSessionSingleton');
 
function compress(queries) {
	var multipleStatements = getSessionSingleton('multipleStatements');
	var compressed = [];
	var queryCount = queries.length;
	var lastIndex = queryCount-1;
	
	for (var i = 0; i < queryCount; i++) {
		var current = queries[i];
		if (multipleStatements && current.parameters.length === 0) {
			for (var i2 = i+1; i2 < queryCount; i2++) {
				var next = queries[i2];
				if (next.parameters.length > 0)
					break;
				current = newParameterized(current.sql() + ';' + next.sql());
				i++;
			}
		}
		compressed.push(current);
	}
	return compressed;
}
 
module.exports = compress;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/getChangeSet.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/getChangeSet.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 71 1       1  
var getSessionSingleton = require('../getSessionSingleton');
function getChangeSet() {
	return getSessionSingleton('changes');
}
 
module.exports = getChangeSet;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/lastCommandMatches.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/lastCommandMatches.js

Statements: 37.5% (3 / 8)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121   1               1  
var getChangeSet = require('./getChangeSet');
 
function lastCommandMatches(row) {
	var changeSet = getChangeSet();
	var lastIndex = changeSet.length-1;
	if (lastIndex >= 0 && changeSet[lastIndex].matches)
		return changeSet[lastIndex].matches(row);
	return false;	
}
 
module.exports = lastCommandMatches;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/negotiateEndEdit.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/negotiateEndEdit.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 81           1  
function negotiateEndEdit(changes) {
	var last = changes[changes.length - 1];
	if (last && last.endEdit) 
		last.endEdit();
}	
 
module.exports = negotiateEndEdit;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newDeleteCommand.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newDeleteCommand.js

Statements: 26.67% (4 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 26.67% (4 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221   1         1                         1  
var newSingleCommand = require('./delete/newSingleCommand');
 
var nextCommand = function() {
	nextCommand = require('./newDeleteCommand');
	nextCommand.apply(null, arguments);
};
 
function newCommand(queries,table,filter,strategy,relations) {	
	var singleCommand = newSingleCommand(table,filter,relations);
	for(var name in strategy) {
		var childStrategy = strategy[name];
		var childRelation = table._relations[name];
		var joinRelation = childRelation.joinRelation;
		var	childRelations = [joinRelation].concat(relations);
		nextCommand(queries,childRelation.childTable,filter,childStrategy,childRelations);
	}
	queries.push(singleCommand);
	return queries;
}
 
module.exports = newCommand;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommand.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommand.js

Statements: 55.56% (10 / 18)      Branches: 100% (0 / 0)      Functions: 0% (0 / 6)      Lines: 55.56% (10 / 18)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361 1   1       1           1       1       1       1   1           1    
var newInsertCommandCore = require('./newInsertCommandCore');
var newImmutable = require('../../newImmutable');
 
function newInsertCommand(table, row) {
    return new InsertCommand(table, row);
}
 
function InsertCommand(table, row) {
    this.__getCoreCommand = newImmutable(newInsertCommandCore);
    this._table = table;
    this._row = row;
}
 
InsertCommand.prototype._getCoreCommand = function() {
    return this.__getCoreCommand(this._table, this._row);
};
 
InsertCommand.prototype.sql = function() {
    return this._getCoreCommand().sql();
};
 
InsertCommand.prototype.matches = function(otherRow) {
    return this._row == otherRow;
};
 
InsertCommand.prototype.endEdit = InsertCommand.prototype.sql;
 
Object.defineProperty(InsertCommand.prototype, 'parameters', {
    get: function() {
        return this._getCoreCommand().parameters;
    }
});
 
module.exports = newInsertCommand;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommandCore.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommandCore.js

Statements: 25% (5 / 20)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 25% (5 / 20)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 301 1 1   1                                             1    
var newParameterized = require('../query/newParameterized');
var getSqlTemplate = require('./insert/getSqlTemplate');
var util = require('util');
 
function newInsertCommandCore(table, row) {
    var command;
    var columnNames = [];
    var parameters = [];
    var values = [getSqlTemplate(table)];
 
    var columns = table._columns;
    for (var i = 0; i < columns.length; i++) {
        var column = columns[i];
        var alias = column.alias;
        var encoded = column.encode(row[alias]);
        if (encoded.parameters.length > 0) {
        	values.push('?');
        	parameters.push(encoded.parameters[0]);
        }
        else
        	values.push(encoded.sql());
    }
 
    var sql = util.format.apply(null, values);
    return newParameterized(sql, parameters);
}
 
module.exports = newInsertCommandCore;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newRow.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newRow.js

Statements: 26.67% (4 / 15)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 26.67% (4 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 261   1       1                                 1    
var decodeDbRow = require('../resultToRows/decodeDbRow');
 
function newRow(table, id, id2, etc) {
    var dto = {};
    table._columns.forEach(addColumn);
 
    function addColumn(column) {
        var alias = column.alias;
        if ('default' in column)
            dto[alias] = column.default;
        else
            dto[alias] = null;
    }
 
    for (var i = 1; i < arguments.length; i++) {
        var pkValue = arguments[i];
        var column = table._primaryColumns[i - 1];
        dto[column.alias] = pkValue;
    }
 
    return decodeDbRow(table, table, dto);
}
 
module.exports = newRow;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommand.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommand.js

Statements: 44.44% (12 / 27)      Branches: 100% (0 / 0)      Functions: 0% (0 / 8)      Lines: 44.44% (12 / 27)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 481 1 1   1       1                   1       1       1           1       1         1       1    
var newUpdateCommandCore = require('./newUpdateCommandCore');
var newImmutable = require('../../newImmutable');
var newColumnList = require('../../newObject');
 
function newUpdateCommand(table, column, row) {
    return new UpdateCommand(table, column, row);
}
 
function UpdateCommand(table, column, row) {
    this._table = table;
    this._row = row;
    this.__getCoreCommand = newImmutable(newUpdateCommandCore);
    this._columnList = newColumnList();
    this._columnList[column.alias] = column;
    this.onFieldChanged = this.onFieldChanged.bind(this)
    row.subscribeChanged(this.onFieldChanged);
}
 
UpdateCommand.prototype.onFieldChanged = function(row, column) {
    this._columnList[column.alias] = column;
};
 
UpdateCommand.prototype.sql = function() {
    return this._getCoreCommand().sql();
};
 
Object.defineProperty(UpdateCommand.prototype, 'parameters', {
    get: function() {
        return this._getCoreCommand().parameters;
    }
});
 
UpdateCommand.prototype._getCoreCommand = function() {
    return this.__getCoreCommand(this._table, this._columnList, this._row);
};
 
UpdateCommand.prototype.endEdit = function() {
    this._getCoreCommand();
    this._row.unsubscribeChanged(this.onFieldChanged);
};
 
UpdateCommand.prototype.matches = function(otherRow) {
    return this._row == otherRow;
};
 
module.exports = newUpdateCommand;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommandCore.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommandCore.js

Statements: 18.75% (6 / 32)      Branches: 0% (0 / 2)      Functions: 0% (0 / 4)      Lines: 18.75% (6 / 32)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 481   1                   1                 1                       1                         1  
var newParameterized = require('../query/newParameterized');
 
function newUpdateCommandCore(table, columns, row) {	
	var columnNames = [];
	var values = [];
	var command = newParameterized("UPDATE " + table._dbName + " SET");
	var separator = " ";
 
	addColumns();
	addWhereId();
	addDiscriminators();
 
	function addColumns() {		
		for (var alias in columns) {
			var column = columns[alias];			
			var encoded = column.encode(row[alias]);
			command = command.append(separator + column._dbName + "=").append(encoded);
			separator = ",";
		}
	}
 
	function addWhereId() {
		separator = " WHERE ";
		var columns = table._primaryColumns;
		for (var i = 0; i < columns.length; i++) {
			var column = columns[i];
			var value = row[column.alias];
			var encoded = column.encode(value);
			command = command.append(separator + column._dbName + "=").append(encoded);
			separator = " AND ";
		}
	}
 
	function addDiscriminators() {
		var discriminators = table._columnDiscriminators;
		if (discriminators.length === 0)
			return;
		discriminators = separator + discriminators.join(" AND ");
		command = command.append(discriminators);
	}
 
	return command;
 
 
}
 
module.exports = newUpdateCommandCore;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/pushCommand.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/pushCommand.js

Statements: 55.56% (5 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 55.56% (5 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131 1 1   1             1  
var getChangeSet = require('./getChangeSet');
var notifyDirty = require('../notifyDirty');
var negotiateEndEdit = require('./negotiateEndEdit');
 
function pushCommand(command) {
	notifyDirty();
	var changes = getChangeSet();
	negotiateEndEdit(changes);
	changes.push(command);
}
 
module.exports = pushCommand;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/rollbackCommand.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/rollbackCommand.js

Statements: 100% (6 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 100% (6 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131   1 1   1 1   1        
var newParameterized = require('../query/newParameterized');
 
var command = newParameterized('ROLLBACK');
function empty() {}
 
command.endEdit = empty;
command.matches = empty;
 
module.exports = command;
 
 
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/beginCommandSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/beginCommandSpec/

Statements: 23.08% (3 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/beginCommandSpec/
File Statements Branches Functions Lines
req.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
whenReq.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/beginCommandSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/beginCommandSpec/req.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 152       1                    
var a = require('a');
var mock = a.mock;
var requireMock = a.requireMock;
 
function act(c){
	c.mock = mock;	
	c.command = {};
	c.newParameterized = requireMock('../query/newParameterized');
	c.newParameterized.expect('BEGIN').return(c.command);
 
	c.sut = require('../beginCommand');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/beginCommandSpec/whenReq.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/beginCommandSpec/whenReq.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 112                    
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return command').assertEqual(c.command, c.sut)
	.it('should set endEdit to empty func').assertDoesNotThrow(c.sut.endEdit)
	.it('should set matches to empty func').assertDoesNotThrow(c.sut.matches)
	
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/commitCommandSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/commitCommandSpec/

Statements: 23.08% (3 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/commitCommandSpec/
File Statements Branches Functions Lines
req.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
whenReq.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/commitCommandSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/commitCommandSpec/req.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 152       1                    
var a = require('a');
var mock = a.mock;
var requireMock = a.requireMock;
 
function act(c){
	c.mock = mock;	
	c.command = {};
	c.newParameterized = requireMock('../query/newParameterized');
	c.newParameterized.expect('COMMIT').return(c.command);
 
	c.sut = require('../commitCommand');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/commitCommandSpec/whenReq.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/commitCommandSpec/whenReq.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 112                    
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return command').assertEqual(c.command, c.sut)
	.it('should set endEdit to empty func').assertDoesNotThrow(c.sut.endEdit)
	.it('should set matches to empty func').assertDoesNotThrow(c.sut.matches)
	
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/

Statements: 13.39% (15 / 112)      Branches: 100% (0 / 0)      Functions: 0% (0 / 5)      Lines: 13.39% (15 / 112)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/
File Statements Branches Functions Lines
compress.js 6.45% (2 / 31) 100% (0 / 0) 0% (0 / 1) 6.45% (2 / 31)
compressAdvanced.js 7.41% (2 / 27) 100% (0 / 0) 0% (0 / 1) 7.41% (2 / 27)
compressEmpty.js 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
compressMultipleStatementsFalse.js 16.67% (2 / 12) 100% (0 / 0) 0% (0 / 1) 16.67% (2 / 12)
compressSimple.js 12.5% (2 / 16) 100% (0 / 0) 0% (0 / 1) 12.5% (2 / 16)
whenCompress.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenCompressAdvanced.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenCompressEmpty.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenCompressMultipleStatementsFalse.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenCompressSimple.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/compress.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/compress.js

Statements: 6.45% (2 / 31)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 6.45% (2 / 31)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 462       1                                                                                  
var a  = require('a');
var mock = a.mock;
var requireMock  = a.requireMock;
 
function act(c){		
	c.requireMock = a.requireMock;
	c.newParameterized = c.requireMock('../query/newParameterized');
	c.getSessionSingleton = c.requireMock('../getSessionSingleton');
	c.getSessionSingleton.expect('multipleStatements').return(true);
 
	c.q1 = {};
	c.q2 = {};
	c.q3 = {};
	c.queries = [c.q1, c.q2, c.q3 ];
	
 
	c.sql1 = '<sql1>';
	c.q1.sql = mock();
	c.q1.sql.expect().return(c.sql1);
	c.q1.parameters = [];
 
	c.sql2 = '<sql2>';
	c.q2.sql = mock();
	c.q2.sql.expect().return(c.sql2);
	c.q2.parameters = [];
 
	
	c.sql3 = '<sql3>';
	c.parameter3 = {};
	c.q3.sql = mock();
	c.q3.sql.expect().return(c.sql3);
	c.q3.parameters = [c.parameter3];
 
	c.compositeSql = '<sql1>;<sql2>';
	c.compositeQuery = {};
	
	c.newParameterized.expect(c.compositeSql).return(c.compositeQuery);
 
	c.expected = [c.compositeQuery, c.q3];
 
	c.returned = require('../compressChanges')(c.queries);
}
 
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/compressAdvanced.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/compressAdvanced.js

Statements: 7.41% (2 / 27)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 7.41% (2 / 27)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41  2     1                                                                        
 
var a  = require('a');
var mock = a.mock;
 
function act(c){	
	c.requireMock = a.requireMock;
	c.newParameterized = c.requireMock('../query/newParameterized');
	c.getSessionSingleton = c.requireMock('../getSessionSingleton');
	c.getSessionSingleton.expect('multipleStatements').return(true);
	
	c.q1 = {};
	c.q2 = {};
	c.q3 = {};
	c.queries = [c.q1, c.q3, c.q2 ];
	
 
	c.sql1 = '<sql1>';
	c.q1.sql = mock();
	c.q1.sql.expect().return(c.sql1);
	c.q1.parameters = [];
 
	c.sql2 = '<sql2>';
	c.q2.sql = mock();
	c.q2.sql.expect().return(c.sql2);
	c.q2.parameters = [];
 
	
	c.sql3 = '<sql3>';
	c.parameter3 = {};
	c.q3.sql = mock();
	c.q3.sql.expect().return(c.sql3);
	c.q3.parameters = [c.parameter3];
 
	c.expected = c.queries;
 
	c.returned = require('../compressChanges')(c.queries);
}
 
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/compressEmpty.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/compressEmpty.js

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 192     1                              
var a  = require('a');
var mock = a.mock;
 
function act(c){		
	c.requireMock = a.requireMock;
	c.newParameterized = c.requireMock('../query/newParameterized');
	c.getSessionSingleton = c.requireMock('../getSessionSingleton');
	c.getSessionSingleton.expect('multipleStatements').return(true);
	
	c.queries = [];
	
	c.expected = c.queries;
 
	c.returned = require('../compressChanges')(c.queries);
}
 
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/compressMultipleStatementsFalse.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/compressMultipleStatementsFalse.js

Statements: 16.67% (2 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 192       1                            
var a  = require('a');
var mock = a.mock;
var requireMock  = a.requireMock;
 
function act(c){		
	c.requireMock = a.requireMock;
	c.newParameterized = c.requireMock('../query/newParameterized');
	c.getSessionSingleton = c.requireMock('../getSessionSingleton');
	c.getSessionSingleton.expect('multipleStatements').return(false);
	
	c.queries = [c.q1, c.q2];
	c.expected = [c.q1, c.q2];
 
	c.returned = require('../compressChanges')(c.queries);
}
 
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/compressSimple.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/compressSimple.js

Statements: 12.5% (2 / 16)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 12.5% (2 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 262     1                                            
var a  = require('a');
var mock = a.mock;
 
function act(c){		
	c.requireMock = a.requireMock;
	c.newParameterized = c.requireMock('../query/newParameterized');
	c.getSessionSingleton = c.requireMock('../getSessionSingleton');
	c.getSessionSingleton.expect('multipleStatements').return(true);
			
	c.q1 = {};
	c.queries = [c.q1];
	
 
	c.sql1 = '<sql1>';
	c.q1.sql = mock();
	c.q1.sql.expect().return(c.sql1);
	c.q1.parameters = [];
 
	c.expected = [c.q1];
 
	c.returned = require('../compressChanges')(c.queries);
}
 
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/whenCompress.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/whenCompress.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return compressed').assertDeepEqual(c.expected, c.returned)
;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/whenCompressAdvanced.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/whenCompressAdvanced.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return compressed').assertDeepEqual(c.expected, c.returned)
;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/whenCompressEmpty.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/whenCompressEmpty.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return compressed').assertDeepEqual(c.expected, c.returned)
;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/whenCompressMultipleStatementsFalse.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/whenCompressMultipleStatementsFalse.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return uncompressed').assertDeepEqual(c.expected, c.returned)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/whenCompressSimple.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/compressChangesSpec/whenCompressSimple.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return compressed').assertDeepEqual(c.expected, c.returned)
;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/

Statements: 47.37% (9 / 19)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 47.37% (9 / 19)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/delete/
File Statements Branches Functions Lines
createAlias.js 40% (2 / 5) 0% (0 / 2) 0% (0 / 1) 40% (2 / 5)
newSingleCommand.js 50% (7 / 14) 0% (0 / 2) 0% (0 / 1) 50% (7 / 14)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/createAlias.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/createAlias.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 71         1  
function createAlias(table, depth) {
	if (depth === 0)
		return table._dbName;
	return '_' + depth;
}
module.exports = createAlias;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/newSingleCommand.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/newSingleCommand.js

Statements: 50% (7 / 14)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 50% (7 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181 1 1 1 1   1                   1  
var newSubFilter = require('./singleCommand/subFilter');
var newDiscriminatorSql = require('../../query/singleQuery/newDiscriminatorSql');
var extractFilter = require('../../query/extractFilter');
var newSingleCommandCore = require('./singleCommand/newSingleCommandCore');
var createAlias = require('./createAlias');
 
function _new(table,filter,relations) {
	var alias = createAlias(table, relations.length);
	filter = extractFilter(filter);
	filter = newSubFilter(relations, filter);
	var discriminator = newDiscriminatorSql(table, alias);
	if (discriminator !== '')
		filter = filter.and(discriminator);
	return newSingleCommandCore(table, filter, alias);
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/singleCommand/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/singleCommand/

Statements: 30.56% (22 / 72)      Branches: 0% (0 / 6)      Functions: 0% (0 / 9)      Lines: 30.56% (22 / 72)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/delete/singleCommand/
File Statements Branches Functions Lines
joinSql.js 27.78% (5 / 18) 100% (0 / 0) 0% (0 / 3) 27.78% (5 / 18)
newSingleCommandCore.js 25% (3 / 12) 0% (0 / 2) 0% (0 / 2) 25% (3 / 12)
selectSql.js 50% (4 / 8) 100% (0 / 0) 0% (0 / 1) 50% (4 / 8)
subFilter.js 40% (6 / 15) 0% (0 / 2) 0% (0 / 1) 40% (6 / 15)
whereSql.js 21.05% (4 / 19) 0% (0 / 2) 0% (0 / 2) 21.05% (4 / 19)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/singleCommand/joinSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/singleCommand/joinSql.js

Statements: 27.78% (5 / 18)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 27.78% (5 / 18)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 301 1   1               1                               1    
var newShallowJoinSql = require('../../../query/singleQuery/joinSql/newShallowJoinSql');
var createAlias = require('../createAlias');
 
function newJoinSql(relations) {
	var length = relations.length;
	var leftAlias,
		rightAlias;
	var c = {};
	var i;
	var sql = '';
 
	function addSql(relation) {
		var rightColumns = relation.childTable._primaryColumns;
		var leftColumns = relation.columns;
		sql += ' INNER' + newShallowJoinSql(relation.childTable,leftColumns,rightColumns,leftAlias,rightAlias);	
	}	
	
	relations.forEach(function(relation, i){
		leftAlias = '_' + (length-i);
		rightAlias = createAlias(relation.childTable, length-i-1);
		addSql(relation);
 
	});
 
	return sql;
}
 
module.exports = newJoinSql;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/singleCommand/newSingleCommandCore.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/singleCommand/newSingleCommandCore.js

Statements: 25% (3 / 12)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 25% (3 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201   1                               1  
var getSessionSingleton = require('../../../getSessionSingleton');
 
function newSingleCommandCore(table,filter,alias) {
	var c = {};
 
	c.sql = function() {
		var whereSql = filter.sql();
		if (whereSql)
			whereSql = ' where ' + whereSql;
		var deleteFromSql = getSessionSingleton('deleteFromSql');
		return deleteFromSql(table, alias, whereSql);
	};
 
	c.parameters = filter.parameters;	
 
	return c;
}
 
module.exports = newSingleCommandCore;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/singleCommand/selectSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/singleCommand/selectSql.js

Statements: 50% (4 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (4 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131 1   1             1    
var newParameterized = require('../../../query/newParameterized');
var newBoolean = require('../../../column/newBoolean');
 
function newSelectSql(table, alias) {
	var colName = table._primaryColumns[0]._dbName;
	var sql = 'SELECT ' + alias + '.' + colName + ' FROM ' + table._dbName + ' AS ' + alias;
	sql = newParameterized(sql);
	return newBoolean(sql);
}
 
module.exports = newSelectSql;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/singleCommand/subFilter.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/singleCommand/subFilter.js

Statements: 40% (6 / 15)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 40% (6 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191 1 1 1 1                         1  
var newSelect = require('./selectSql');
var newJoin = require('./joinSql');
var newWhere = require('./whereSql');
var createAlias = require('../createAlias');
function newSubFilter(relations, shallowFilter) {
	var relationCount = relations.length;
	if (relationCount === 0)
		return shallowFilter;
	var table = relations[0].childTable;
	var alias = createAlias(table, relationCount -1);
	var filter = newSelect(table,alias).prepend('EXISTS (');
	var join = newJoin(relations.slice(1));
	var where = newWhere(relations,shallowFilter,alias);
	return filter.append(join).append(where).append(')');
 
}
 
module.exports = newSubFilter;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/singleCommand/whereSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/delete/singleCommand/whereSql.js

Statements: 21.05% (4 / 19)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 21.05% (4 / 19)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 271   1                     1                     1    
var newShallowJoinSql = require('../../../query/singleQuery/joinSql/newShallowJoinSqlCore');
 
function newWhereSql(relations, shallowFilter, rightAlias) {
    var c = {};
    var sql;
    var relationCount = relations.length;
    var relation = relations[0];
    var leftAlias = '_' + relationCount;
    var table = relation.childTable;
    var leftColumns = relation.columns;
    var rightColumns = table._primaryColumns;
    where(leftColumns, rightColumns);
 
    function where() {
        var table = relation.childTable;
        var joinCore = newShallowJoinSql(table, leftColumns, rightColumns, leftAlias, rightAlias);
        if (shallowFilter)
            sql = shallowFilter.prepend(' WHERE ' + joinCore + ' AND ');
        else
            sql = ' WHERE ' + joinCore;
    }
    return sql;
}
 
module.exports = newWhereSql;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/getChangeSetSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/getChangeSetSpec/

Statements: 27.27% (3 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 27.27% (3 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/getChangeSetSpec/
File Statements Branches Functions Lines
get.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
whenGet.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/getChangeSetSpec/get.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/getChangeSetSpec/get.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 132     1                  
var a = require('a');
var expectRequire = a.expectRequire;
 
function act(c){
	c.changeSet = {};
	c.getSessionSingleton = a.requireMock('../getSessionSingleton');
	c.getSessionSingleton.expect('changes').return(c.changeSet);
 
	c.returned = require('../getChangeSet')();
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/getChangeSetSpec/whenGet.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/getChangeSetSpec/whenGet.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return changeSet').assertEqual(c.changeSet, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/insert/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/insert/

Statements: 16.67% (4 / 24)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 16.67% (4 / 24)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/insert/
File Statements Branches Functions Lines
getSqlTemplate.js 16.67% (4 / 24) 0% (0 / 2) 0% (0 / 3) 16.67% (4 / 24)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/insert/getSqlTemplate.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/insert/getSqlTemplate.js

Statements: 16.67% (4 / 24)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 16.67% (4 / 24)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 331                       1                 1                   1  
function getSqlTemplate(table) {
	if (table._insertTemplate)
		return table._insertTemplate;
    var columnNames = [];
    var values = [];
    var sql = "INSERT INTO " + table._dbName + " (";
    addDiscriminators();
    addColumns();
    sql = sql + columnNames.join(",") + ") VALUES (" + values.join(',') + ")";
	table._insertTemplate = sql;
    return sql;
 
    function addDiscriminators() {
        var discriminators = table._columnDiscriminators;
        for (var i = 0; i < discriminators.length; i++) {
            var parts = discriminators[i].split("=");
            columnNames.push(parts[0]);
            values.push(parts[1]);
        }
    }
 
    function addColumns() {
        var columns = table._columns;
        for (var i = 0; i < columns.length; i++) {
            var column = columns[i];
            columnNames.push(column._dbName);
            values.push('%s');
        }
    }
}
 
module.exports = getSqlTemplate;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/lastCommandMatchesSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/lastCommandMatchesSpec/

Statements: 28.57% (2 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 28.57% (2 / 7)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/lastCommandMatchesSpec/
File Statements Branches Functions Lines
req.js 28.57% (2 / 7) 100% (0 / 0) 0% (0 / 1) 28.57% (2 / 7)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/lastCommandMatchesSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/lastCommandMatchesSpec/req.js

Statements: 28.57% (2 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 28.57% (2 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 122     1                
var a = require('a');
var requireMock = a.requireMock;
 
function act(c){
	c.mock = a.mock;
	c.getChangeSet = requireMock('./getChangeSet');
 
	c.sut = require('../lastCommandMatches');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/negotiateEndEditSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/negotiateEndEditSpec/

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/negotiateEndEditSpec/
File Statements Branches Functions Lines
req.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/negotiateEndEditSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/negotiateEndEditSpec/req.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 142   1                      
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
 
	c.sut = require('../negotiateEndEdit');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newDeleteCommandSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newDeleteCommandSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/newDeleteCommandSpec/
File Statements Branches Functions Lines
when_new.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newDeleteCommandSpec/when_new.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newDeleteCommandSpec/when_new.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when('./new',c)
	.it('should add sub commands').assertDoesNotThrow(c.nextDeleteCommand.verify)
	.it('should push singleCommand to queries').assertDoesNotThrow(c.queries.push.verify)
	.it('returns queries').assertEqual(c.queries,c.returned)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommandCoreSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommandCoreSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommandCoreSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommandCoreSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommandCoreSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return insertCommand').assertEqual(c.expected, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommandSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommandSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommandSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommandSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newInsertCommandSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 102                  
var when = require('a').when;
var c = {};
 
when(c)
	.it('endEdit points at sut.sql').assertEqual(c.sut.sql, c.sut.endEdit)
	.it('should set parameters').assertEqual(c.parameters, c.sut.parameters)
	.it('should set sql').assertEqual(c.sql, c.sut.sql())	
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newRowSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newRowSpec/

Statements: 6.45% (2 / 31)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 6.45% (2 / 31)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/newRowSpec/
File Statements Branches Functions Lines
req.js 6.45% (2 / 31) 100% (0 / 0) 0% (0 / 1) 6.45% (2 / 31)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newRowSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newRowSpec/req.js

Statements: 6.45% (2 / 31)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 6.45% (2 / 31)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 442       1                                                                              
var a = require('a');
var mock = a.mock;
var requireMock = a.requireMock;
 
function act(c){
	c.decodeDbRow = requireMock('../resultToRows/decodeDbRow');
 
	c.row = {};
	c.mock = mock;	
	c.table = {};
 
	c.id = 1;
	c.primaryColumn = {};
	c.primaryColumn.alias = 'pkAlias';	
 
	c.id2 = 'two';
	c.primaryColumn2 = {};
	c.primaryColumn2.alias = 'pkAlias2';	
 
	c.primaryColumns = [c.primaryColumn, c.primaryColumn2];
	c.table._primaryColumns = c.primaryColumns;
 
	c.column = {};
	c.column.alias = 'alias';	
	c.defaultValue = 'def';	
	c.column.default = c.defaultValue;
	
	c.column2 = {};
	c.column2.alias = 'alias2';	
 
	c.columns = [c.column, c.primaryColumn, c.column2, c.primaryColumn2];
	c.table._columns = c.columns;
 
	c.rowDto = {};
	c.rowDto.alias = c.defaultValue;
	c.rowDto.alias2 = null;
	c.rowDto.pkAlias = c.id;
	c.rowDto.pkAlias2 = c.id2;
 
	c.sut = require('../newRow');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommandCoreSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommandCoreSpec/

Statements: 2.35% (2 / 85)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 2.35% (2 / 85)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommandCoreSpec/
File Statements Branches Functions Lines
req.js 2.35% (2 / 85) 100% (0 / 0) 0% (0 / 1) 2.35% (2 / 85)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommandCoreSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommandCoreSpec/req.js

Statements: 2.35% (2 / 85)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 2.35% (2 / 85)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 1112       1                                                                                                                                                                                                                    
var a = require('a');
var mock = a.mock;
var requireMock = a.requireMock;
 
function act(c){
	c.columnList = {};
 
	c.mock = mock;	
	c.table = {};
	c.tableName = 'theTable';
	c.table._dbName = c.tableName;
 
	c.row = {};
	c.value1 = 'value 1';
	c.encodedValue1 = {};
	c.alias1 = 'alias 1';
	c.row[c.alias1] = c.value1;
 
	c.value2 = 'value 2';
	c.encodedValue2 = {};
	c.alias2 = 'alias 2';
	c.row[c.alias2] = c.value2;
 
	c.pkValue1 = 'pkvalue 1';
	c.encodedPk1 = {};
	c.pkAlias1 = 'pkalias 1';
	c.row[c.pkAlias1] = c.pkValue1;
 
	c.pkValue2 = 'pkvalue 2';
	c.encodedPk2 = {};
	c.pkAlias2 = 'pkalias 2';
	c.row[c.pkAlias2] = c.pkValue2;
 
	c.column1 = {};
	c.columnName1 = 'colName1';
	c.column1._dbName = c.columnName1;
	c.column1.alias = c.alias1;
	c.column1.encode = c.mock();
	c.column1.encode.expect(c.value1).return(c.encodedValue1);
 
	c.column2 = {};
	c.columnName2 = 'colName2';
	c.column2._dbName = c.columnName2;
	c.column2.alias = c.alias2;
	c.column2.encode = c.mock();
	c.column2.encode.expect(c.value2).return(c.encodedValue2);
 
	c.pkColumn1 = {};
	c.pkColumnName1 = 'pk1';
	c.pkColumn1._dbName = c.pkColumnName1;
	c.pkColumn1.alias = c.pkAlias1;
	c.pkColumn1.encode = c.mock();
	c.pkColumn1.encode.expect(c.pkValue1).return(c.encodedPk1);
 
	c.pkColumn2 = {};
	c.pkColumnName2 = 'pk2';
	c.pkColumn2._dbName = c.pkColumnName2;
	c.pkColumn2.alias = c.pkAlias2;
	c.pkColumn2.encode = c.mock();
	c.pkColumn2.encode.expect(c.pkValue2).return(c.encodedPk2);
 
	c.table._primaryColumns = [c.pkColumn1, c.pkColumn2];
 
	c.columnList[c.alias1] = c.column1;
	c.columnList[c.alias2] = c.column2;
 
	c.part0 = {};
	c.newParameterized = requireMock('../query/newParameterized');
	c.newParameterized.expect("UPDATE theTable SET").return(c.part0);
 
	c.part1 = {};
	c.part0.append = c.mock();
	c.part0.append.expect(" colName1=").return(c.part1);
 
	c.part2 = {};
	c.part1.append = c.mock();
	c.part1.append.expect(c.encodedValue1).return(c.part2);
 
	c.part3 = {};
	c.part2.append = c.mock();
	c.part2.append.expect(",colName2=").return(c.part3);
 
	c.part4 = {};
	c.part3.append = c.mock();
	c.part3.append.expect(c.encodedValue2).return(c.part4);
 
	c.part5 = {};
	c.part4.append = c.mock();
	c.part4.append.expect(" WHERE pk1=").return(c.part5);
 
	c.part6 = {};
	c.part5.append = c.mock();
	c.part5.append.expect(c.encodedPk1).return(c.part6);
 
	c.part7 = {};
	c.part6.append = c.mock();
	c.part6.append.expect(" AND pk2=").return(c.part7);
 
	c.part8 = {};
	c.part7.append = c.mock();
	c.part7.append.expect(c.encodedPk2).return(c.part8);
 
	c.expected = {};
	c.part8.append = c.mock();
	c.part8.append.expect(" AND fooColumn='fooDiscr' AND barColumn='barDiscr'").return(c.expected);
 
	c.sut = require('../newUpdateCommandCore');	
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommandSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommandSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommandSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommandSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/newUpdateCommandSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should set column on ColumnList with alias').assertEqual(c.column, c.columnList[c.alias])
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/pushCommandSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/pushCommandSpec/

Statements: 18.75% (3 / 16)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.75% (3 / 16)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/pushCommandSpec/
File Statements Branches Functions Lines
push.js 15.38% (2 / 13) 100% (0 / 0) 0% (0 / 1) 15.38% (2 / 13)
whenPush.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/pushCommandSpec/push.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/pushCommandSpec/push.js

Statements: 15.38% (2 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 15.38% (2 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 202   1                                  
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.getChangeSet = a.requireMock('./getChangeSet');
	c.notifyDirty = a.requireMock('../notifyDirty');
	
	c.changeSet = {};
	c.command = {};
	c.changeSet.push = c.mock();
	c.changeSet.push.expect(c.command);
	c.getChangeSet.expect().return(c.changeSet);
 
	c.notifyDirty.expect();
 
	require('../pushCommand')(c.command);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/pushCommandSpec/whenPush.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/pushCommandSpec/whenPush.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should notify dirty').assertDoesNotThrow(c.notifyDirty.verify)
	.it('should push command to changeSet').assertDoesNotThrow(c.changeSet.push.verify)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/rollbackCommandSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/rollbackCommandSpec/

Statements: 23.08% (3 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commands/rollbackCommandSpec/
File Statements Branches Functions Lines
req.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
whenReq.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/rollbackCommandSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/rollbackCommandSpec/req.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 152       1                    
var a = require('a');
var mock = a.mock;
var requireMock = a.requireMock;
 
function act(c){
	c.mock = mock;	
	c.command = {};
	c.newParameterized = requireMock('../query/newParameterized');
	c.newParameterized.expect('ROLLBACK').return(c.command);
 
	c.sut = require('../rollbackCommand');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/rollbackCommandSpec/whenReq.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commands/rollbackCommandSpec/whenReq.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 112                    
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return command').assertEqual(c.command, c.sut)
	.it('should set endEdit to empty func').assertDoesNotThrow(c.sut.endEdit)
	.it('should set matches to empty func').assertDoesNotThrow(c.sut.matches)
	
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commitSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commitSpec/

Statements: 16.67% (2 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commitSpec/
File Statements Branches Functions Lines
req.js 16.67% (2 / 12) 100% (0 / 0) 0% (0 / 1) 16.67% (2 / 12)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commitSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commitSpec/req.js

Statements: 16.67% (2 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  2         1                          
 
var a  = require('a');
var mock = a.mock;
var requireMock  = a.requireMock;
 
 
function act(c){		
	c.mock = mock;
	c.commitCommand = requireMock('./commands/commitCommand');
	c.pushCommand = requireMock('./commands/pushCommand');
	c.executeChanges = requireMock('./executeQueries/executeChanges');
	c.releaseDbClient = requireMock('./releaseDbClient');
	c.popChanges = requireMock('./popChanges');
	
	c.sut = require('../commit');
}
 
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commitSpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commitSpec/req/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/commitSpec/req/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commitSpec/req/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/commitSpec/req/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should push commitCommand').assertDoesNotThrow(c.pushCommand.verify)
	.it('should execute changes').assertEqual(c.expected, c.returned)
;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/

Statements: 13.04% (3 / 23)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 13.04% (3 / 23)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/
File Statements Branches Functions Lines
create.js 10% (2 / 20) 100% (0 / 0) 0% (0 / 1) 10% (2 / 20)
whenCreate.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/create.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/create.js

Statements: 10% (2 / 20)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 10% (2 / 20)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 282   1                                                  
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	c.table = {};
	c.db = {};
	c.filter = {};
	c.strategy = {};
	c.streamOptions = {};
	
	c.createReadStreamCore = c.requireMock('./createReadStreamCoreNative');
	c.Stream = c.requireMock('stream');
 
	c.Stream.Transform = c.mock();
	c.transformer = {};
	c.Stream.Transform.expect({objectMode: true}).return(c.transformer);
	
	c.expected = {};
	c.createReadStreamCore.expect(c.table, c.db, c.filter, c.strategy, c.transformer, c.streamOptions).return(c.expected);
 
	c.returned = require('../createJSONReadStreamNative')(c.table, c.db, c.filter, c.strategy, c.streamOptions);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/whenCreate.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/whenCreate.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return stream').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/create/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/create/

Statements: 13.04% (3 / 23)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 13.04% (3 / 23)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/create/
File Statements Branches Functions Lines
whenWrite.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
write.js 10% (2 / 20) 100% (0 / 0) 0% (0 / 1) 10% (2 / 20)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/create/whenWrite.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/create/whenWrite.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
    .it('should push JSON to stream array').assertDoesNotThrow(c.transformer.push.verify)
    .it('should invoke callbacks').assertDoesNotThrow(c.cb.verify)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/create/write.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createJSONReadStreamNativeSpec/create/write.js

Statements: 10% (2 / 20)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 10% (2 / 20)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 342   1                                                              
var a = require('a');
 
function act(c) {
    c.mock = a.mock;
    c.requireMock = a.requireMock;
    c.expectRequire = a.expectRequire;
    c.then = a.then;
 
    c.transformer.push = c.mock();
    c.chunk = {
        result: {
        }
    };
    c.chunk2 = {
        result: {
        }
    };
    c.enc = {};
    c.cb = c.mock();
    c.cb.expect().repeat(3);
 
    c.transformer.push.expect('[');
    c.transformer.push.expect(c.chunk.result);
    c.transformer.push.expect(',' + c.chunk2.result);
    c.transformer.push.expect(']');
 
    c.transformer._transform(c.chunk, c.enc, c.cb);
    c.transformer._transform(c.chunk2, c.enc, c.cb);
    c.transformer._flush(c.cb);
}
 
module.exports = act;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/

Statements: 13.04% (3 / 23)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 13.04% (3 / 23)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/
File Statements Branches Functions Lines
create.js 10% (2 / 20) 100% (0 / 0) 0% (0 / 1) 10% (2 / 20)
whenCreate.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/create.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/create.js

Statements: 10% (2 / 20)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 10% (2 / 20)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 282   1                                                  
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	c.table = {};
	c.db = {};
	c.filter = {};
	c.strategy = {};
	c.streamOptions = {};
	
	c.createReadStreamCore = c.requireMock('./createReadStreamCoreNative');
	c.Stream = c.requireMock('stream');
 
	c.Stream.Transform = c.mock();
	c.transformer = {};
	c.Stream.Transform.expect({objectMode: true}).return(c.transformer);
	
	c.expected = {};
	c.createReadStreamCore.expect(c.table, c.db, c.filter, c.strategy, c.transformer, c.streamOptions).return(c.expected);
 
	c.returned = require('../createReadStreamNative')(c.table, c.db, c.filter, c.strategy, c.streamOptions);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/whenCreate.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/whenCreate.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return stream').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/create/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/create/

Statements: 13.64% (3 / 22)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 13.64% (3 / 22)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/create/
File Statements Branches Functions Lines
whenWrite.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
write.js 10.53% (2 / 19) 100% (0 / 0) 0% (0 / 1) 10.53% (2 / 19)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/create/whenWrite.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/create/whenWrite.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
    .it('should push JSON to stream array').assertDoesNotThrow(c.transformer.push.verify)
    .it('should invoke callbacks').assertDoesNotThrow(c.cb.verify)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/create/write.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/createReadStreamNativeSpec/create/write.js

Statements: 10.53% (2 / 19)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 10.53% (2 / 19)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 372   1                                                                    
var a = require('a');
 
function act(c) {
    c.mock = a.mock;
    c.requireMock = a.requireMock;
    c.expectRequire = a.expectRequire;
    c.then = a.then;
 
    c.transformer.push = c.mock();
    c.expectedObject1 = {
        a: 1,
        b: 2
    };
    c.expectedObject2 = {
        a: 11,
        b: 22
    };
    c.chunk = {
        result: JSON.stringify(c.expectedObject1)
    };
    c.chunk2 = {
        result: JSON.stringify(c.expectedObject2)
    };
    c.enc = {};
    c.cb = c.mock();
    c.cb.expect().repeat(2);
 
    c.transformer.push.expect(c.expectedObject1);
    c.transformer.push.expect(c.expectedObject2);
 
    c.transformer._transform(c.chunk, c.enc, c.cb);
    c.transformer._transform(c.chunk2, c.enc, c.cb);
}
 
module.exports = act;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/deleteSessionContextSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/deleteSessionContextSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/deleteSessionContextSpec/
File Statements Branches Functions Lines
whenDelete.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/deleteSessionContextSpec/whenDelete.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/deleteSessionContextSpec/whenDelete.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
.it('should should delete rdb property from domain').assertEqual(false, 'rdb' in c.domain)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/deleteSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/deleteSpec/

Statements: 13.33% (2 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 13.33% (2 / 15)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/deleteSpec/
File Statements Branches Functions Lines
req.js 13.33% (2 / 15) 100% (0 / 0) 0% (0 / 1) 13.33% (2 / 15)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/deleteSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/deleteSpec/req.js

Statements: 13.33% (2 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 13.33% (2 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 222   1                                      
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
 
	c.pushCommand = c.requireMock('./commands/pushCommand');
	c.newDeleteCommand = c.requireMock('./commands/newDeleteCommand');
	c.extractDeleteStrategy = c.requireMock('./extractDeleteStrategy');
	c.resultToPromise = c.requireMock('./resultToPromise');
	c.negotiateRawSqlFilter = c.requireMock('./column/negotiateRawSqlFilter');
	
	c.emptyPromise = {};
	c.resultToPromise.expect().return(c.emptyPromise);
 
	c.sut = require('../delete')
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/deleteSpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/deleteSpec/req/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/deleteSpec/req/
File Statements Branches Functions Lines
whenDelete.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/deleteSpec/req/whenDelete.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/deleteSpec/req/whenDelete.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
    .it('should return emptyPromise').assertEqual(c.emptyPromise, c.returned)
    .it('should push deleteCommands').assertDoesNotThrow(c.pushCommand.verify)
    
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/domainCache/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/domainCache/

Statements: 45.45% (5 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 45.45% (5 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/domainCache/
File Statements Branches Functions Lines
getCache.js 45.45% (5 / 11) 0% (0 / 2) 0% (0 / 1) 45.45% (5 / 11)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/domainCache/getCache.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/domainCache/getCache.js

Statements: 45.45% (5 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 45.45% (5 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1 1   1                     1  
var newCache = require('../newCache');
var getSessionSingleton = require('../getSessionSingleton');
var setSessionSingleton = require('../setSessionSingleton');
 
function getCache(id) {
	var cache = getSessionSingleton(id);
	if (cache)
		return cache;
	cache = newCache();
	setSessionSingleton(id, cache);
	return cache;
}
 
 
 
module.exports = getCache;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/domainCache/getCacheSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/domainCache/getCacheSpec/

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/domainCache/getCacheSpec/
File Statements Branches Functions Lines
req.js 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/domainCache/getCacheSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/domainCache/getCacheSpec/req.js

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 172   1                            
var a = require('a');
 
function act(c){
	c.requireMock = a.requireMock;
	
	c.newCache = a.requireMock('../newCache');
	c.id = 'id';
 
	c.getSessionSingleton = c.requireMock('../getSessionSingleton');
	c.setSessionSingleton = c.requireMock('../setSessionSingleton');
	
 
	c.sut = require('../getCache');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/
File Statements Branches Functions Lines
req.js 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/req.js

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 152   1                        
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	c.getSessionSingleton = c.requireMock('./getSessionSingleton');
	
 
	c.sut = require('../encodeDbSpecific');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/req/

Statements: 30% (6 / 20)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 30% (6 / 20)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/req/
File Statements Branches Functions Lines
encodeSpecific.js 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
encodeStandard.js 40% (2 / 5) 100% (0 / 0) 0% (0 / 1) 40% (2 / 5)
whenEncodeSpecific.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenEncodeStandard.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/req/encodeSpecific.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/req/encodeSpecific.js

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131                     1  
function act(c){
	c.expected = {};
	c.value = {};
		
	c.encodeBoolean = c.mock();
	c.getSessionSingleton.expect('encodeBoolean').return(c.encodeBoolean);
	c.encodeBoolean.expect(c.value).return(c.expected);
	c.getSessionSingleton.expect(c.encodeBoolean);
	c.returned = c.sut('Boolean', c.value)
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/req/encodeStandard.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/req/encodeStandard.js

Statements: 40% (2 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 91             1  
function act(c){
	c.value = {};
		
	c.getSessionSingleton.expect('encodeBoolean').return();
	c.returned = c.sut('Boolean', c.value)
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/req/whenEncodeSpecific.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/req/whenEncodeSpecific.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return encoded value for db').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/req/whenEncodeStandard.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/encodeDbSpecificSpec/req/whenEncodeStandard.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return value unchanged').assertEqual(c.value, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/

Statements: 36.96% (17 / 46)      Branches: 0% (0 / 12)      Functions: 0% (0 / 7)      Lines: 36.96% (17 / 46)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/executeQueries/
File Statements Branches Functions Lines
executeChanges.js 38.46% (5 / 13) 0% (0 / 4) 0% (0 / 2) 38.46% (5 / 13)
executeQueriesCore.js 37.5% (3 / 8) 100% (0 / 0) 0% (0 / 1) 37.5% (3 / 8)
executeQuery.js 66.67% (4 / 6) 100% (0 / 0) 0% (0 / 1) 66.67% (4 / 6)
resolveExecuteQuery.js 26.32% (5 / 19) 0% (0 / 8) 0% (0 / 3) 26.32% (5 / 19)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeChanges.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeChanges.js

Statements: 38.46% (5 / 13)      Branches: 0% (0 / 4)      Functions: 0% (0 / 2)      Lines: 38.46% (5 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241 1   1             1                       1  
var executeQuery = require('./executeQuery');
var newPromise = require('../promise');
 
function executeChanges(queries) {
	if (queries.length === 0)
		return newPromise();
	var i = -1;
	return execute();
 
 
	function execute() {
		i++;
		if (i+1 == queries.length )
			return executeQuery(queries[i]);
		else {
			return executeQuery(queries[i]).then(execute);
		}
			
	}
	
}
 
module.exports = executeChanges;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQueriesCore.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQueriesCore.js

Statements: 37.5% (3 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131   1                 1  
var executeQuery = require('./executeQuery');
 
function executeQueriesCore(queries) {
	var promises = [];
	for (var i = 0; i < queries.length; i++) {
		var q = executeQuery(queries[i]);
		promises.push(q);
	}
	return promises;
}
 
module.exports = executeQueriesCore;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQuery.js

Statements: 66.67% (4 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (4 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 101 1   1         1  
var newResolver = require('./resolveExecuteQuery');
var newPromise = require('../promise');
 
function executeQuery(query) {
	var resolver = newResolver(query);
	return newPromise(resolver);
}
 
module.exports = executeQuery;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/resolveExecuteQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/resolveExecuteQuery.js

Statements: 26.32% (5 / 19)      Branches: 0% (0 / 8)      Functions: 0% (0 / 3)      Lines: 26.32% (5 / 19)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361   1     1                     1                                 1    
var getSessionSingleton = require('../getSessionSingleton');
 
function resolveExecuteQuery(query) {
    return resolve;
 
    function resolve(success, failed) {
        var domain = process.domain;
        if (domain) {
            success = process.domain.bind(success);
            failed = process.domain.bind(failed);
        }
 
        var client = getSessionSingleton('dbClient');
 
        client.executeQuery(query, onCompleted);
 
        function onCompleted(err, rows) {
            if (!err) {
                var lastIndex = rows.length - 1;
                if (!Array.isArray(rows[0]) && Array.isArray(rows[lastIndex]))
                    rows = rows[lastIndex];
                Object.defineProperty(rows, 'queryContext', {
                    value: query.queryContext,
                    enumerable: false
                });
                success(rows);
            } else
                failed(err);
        }
    }
 
}
 
module.exports = resolveExecuteQuery;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeChangesSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeChangesSpec/

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeChangesSpec/
File Statements Branches Functions Lines
req.js 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeChangesSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeChangesSpec/req.js

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  2         1                    
 
var a  = require('a');
var mock = a.mock;
var requireMock  = a.requireMock;
 
 
function act(c){		
	c.mock = mock;
	c.executeQuery = requireMock('./executeQuery');
	c.newPromise = requireMock('../promise');
 
	c.sut = require('../executeChanges');
}
 
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQueriesCoreSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQueriesCoreSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQueriesCoreSpec/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQueriesCoreSpec/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQueriesCoreSpec/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c).
	it('should return results').assertDeepEqual(c.expected,c.returned);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQuerySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQuerySpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQuerySpec/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQuerySpec/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/executeQuerySpec/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c).
	it('should return promise').assertEqual(c.expected,c.returned);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/resolveExecuteQuerySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/resolveExecuteQuerySpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/executeQueries/resolveExecuteQuerySpec/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/resolveExecuteQuerySpec/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueries/resolveExecuteQuerySpec/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('should run query against client').assertDoesNotThrow(c.dbClient.executeQuery.verify)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/

Statements: 35.71% (5 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 35.71% (5 / 14)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/
File Statements Branches Functions Lines
req.js 35.71% (5 / 14) 100% (0 / 0) 0% (0 / 1) 35.71% (5 / 14)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/req.js

Statements: 35.71% (5 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 35.71% (5 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 202 2 2 2       1                        
var q1 = {};
var q2 = {};
var queries = [q1,q2];
var a  = require('a');
var mock = a.mock;
var requireMock  = a.requireMock;
 
function act(c){
	c.executeQueriesCore = requireMock('./executeQueries/executeQueriesCore');
	c.executeChanges = requireMock('./executeQueries/executeChanges');
	c.popChanges = requireMock('./popChanges');
	c.newParameterized = requireMock('./query/newParameterized');
	c.getSessionSingleton = requireMock('./getSessionSingleton');	
 
	c.sut = require('../executeQueries');
}
 
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/hasParams/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/hasParams/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/hasParams/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/hasParams/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/hasParams/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should invoke executeQueriesCore').assertEqual(c.executeQueriesCoreResult, c.queryResult)
	.it('should return expected promise').assertEqual(c.expected,c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/multipleStatementsNotAllowed/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/multipleStatementsNotAllowed/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/multipleStatementsNotAllowed/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/multipleStatementsNotAllowed/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/multipleStatementsNotAllowed/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should invoke executeQueriesCore').assertEqual(c.executeQueriesCoreResult, c.queryResult)
	.it('should return expected promise').assertEqual(c.expected,c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/noChanges/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/noChanges/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/noChanges/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/noChanges/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/noChanges/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should invoke executeQueriesCore').assertEqual(c.executeQueriesCoreResult, c.queryResult)
	.it('should return expected promise').assertEqual(c.expected,c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/noParams/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/noParams/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/noParams/
File Statements Branches Functions Lines
whenExecute.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/noParams/whenExecute.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/executeQueriesSpec/noParams/whenExecute.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 102                  
var when = require('a').when;
var c = {};
 
when(c)
	.it('should invoke executeQueriesCore').assertEqual(c.executeQueriesCoreResult, c.queryResult)
	.it('should return expected promise').assertEqual(c.expected,c.returned)
	;
 
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/
File Statements Branches Functions Lines
req.js 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/req.js

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 172   1                            
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
 
	c.emptyStrategy = {};
	c.newObject = c.requireMock('../newObject');
	c.newObject.expect().return(c.emptyStrategy);
		
	c.sut = require('../extractDeleteStrategy');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/hasStrategy/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/hasStrategy/

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/hasStrategy/
File Statements Branches Functions Lines
extract.js 50% (2 / 4) 100% (0 / 0) 0% (0 / 1) 50% (2 / 4)
whenExtract.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/hasStrategy/extract.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/hasStrategy/extract.js

Statements: 50% (2 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (2 / 4)      Ignored: none     

1 2 3 4 5 6 7 81           1  
function act(c){
	
	c.strategy = {};
	c.returned = c.sut(c.strategy);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/hasStrategy/whenExtract.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/hasStrategy/whenExtract.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return strategy').assertEqual(c.strategy, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/noStrategy/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/noStrategy/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/noStrategy/
File Statements Branches Functions Lines
whenExtract.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/noStrategy/whenExtract.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/extractDeleteStrategySpec/noStrategy/whenExtract.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return empty strategy').assertEqual(c.emptyStrategy, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getByIdSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getByIdSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/getByIdSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getByIdSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getByIdSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('sets exclusive').assertEqual(c.getFromDbById.exclusive, c.sut.exclusive);
	
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getManySpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getManySpec/new/

Statements: 33.33% (6 / 18)      Branches: 100% (0 / 0)      Functions: 0% (0 / 6)      Lines: 33.33% (6 / 18)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/getManySpec/new/
File Statements Branches Functions Lines
get.js 40% (2 / 5) 100% (0 / 0) 0% (0 / 2) 40% (2 / 5)
getExclusive.js 40% (2 / 5) 100% (0 / 0) 0% (0 / 2) 40% (2 / 5)
whenGetExclusive.js 25% (1 / 4) 100% (0 / 0) 0% (0 / 1) 25% (1 / 4)
when_get.js 25% (1 / 4) 100% (0 / 0) 0% (0 / 1) 25% (1 / 4)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getManySpec/new/get.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getManySpec/new/get.js

Statements: 40% (2 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121                 1    
function act(c) {
    c.newSelectQuery.expect([], c.table, c.filter, c.span, c.dbName, c.emptyInnerJoin, undefined, undefined).return(c.queries);
 
    return c.sut(c.table, c.initialFilter, c.strategy).then(function(ret) {
        c.returned = ret;
    });
 
}
 
module.exports = act;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getManySpec/new/getExclusive.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getManySpec/new/getExclusive.js

Statements: 40% (2 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121                 1    
function act(c) {
    c.newSelectQuery.expect([], c.table, c.filter, c.span, c.dbName, c.emptyInnerJoin, undefined, true).return(c.queries);
 
    return c.sut.exclusive(c.table, c.initialFilter, c.strategy).then(function(ret) {
        c.returned = ret;
    });
 
}
 
module.exports = act;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getManySpec/new/whenGetExclusive.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getManySpec/new/whenGetExclusive.js

Statements: 25% (1 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (1 / 4)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c).then(function(it) {
	it('should return rows').assertEqual(c.rows,c.returned);	
});
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getManySpec/new/when_get.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getManySpec/new/when_get.js

Statements: 25% (1 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (1 / 4)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c).then(function(it) {
	it('should return rows').assertEqual(c.rows,c.returned);	
});
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/

Statements: 11.76% (2 / 17)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 11.76% (2 / 17)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/
File Statements Branches Functions Lines
req.js 11.76% (2 / 17) 100% (0 / 0) 0% (0 / 1) 11.76% (2 / 17)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/req.js

Statements: 11.76% (2 / 17)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 11.76% (2 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 272   1                                                
var a = require('a');
 
function act(c) {
	c.then = a.then;
	c.mock = a.mock;
	c.requireMock = a.requireMock;
 
	c.legToQuery = c.mock();
	c.executeQueries = c.requireMock('./executeQueries');
	c.resultToRows = c.requireMock('./resultToRows');
 
	c.resultToPromise = c.requireMock('./resultToPromise');
 
	c.negotiateExpandInverse = c.requireMock('./negotiateExpandInverse');
 
	c.emptyPromise = c.then();
	c.emptyPromise.resolve();
	c.resultToPromise.expect(false).return(c.emptyPromise);
 
	c.parent = {};
	c.relation = {};
 
	c.sut = require('../getRelativesCore');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/hasContext/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/hasContext/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/hasContext/
File Statements Branches Functions Lines
whenGet.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/hasContext/whenGet.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/hasContext/whenGet.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should expand relation').assertDoesNotThrow(c.queryContext.expand.verify)
	.it('should negotiate expand inverse').assertDoesNotThrow(c.negotiateExpandInverse.verify)	
	.it('returns rows').assertEqual(c.rows, c.returned)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/noContext/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/noContext/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/noContext/
File Statements Branches Functions Lines
whenGet.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/noContext/whenGet.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getRelativesCoreSpec/noContext/whenGet.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should not get related rows').assertOk(c.didNotCrash)
;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionContextSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionContextSpec/

Statements: 18.75% (3 / 16)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.75% (3 / 16)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/getSessionContextSpec/
File Statements Branches Functions Lines
get.js 15.38% (2 / 13) 100% (0 / 0) 0% (0 / 1) 15.38% (2 / 13)
whenGet.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionContextSpec/get.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionContextSpec/get.js

Statements: 15.38% (2 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 15.38% (2 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 212   1                                    
var a = require('a');
 
function act(c) {
    c.mock = a.mock;
    c.requireMock = a.requireMock;
    c.expectRequire = a.expectRequire;
    c.then = a.then;
 
    var oldDomain = process.domain;
    process.domain = {};
    c.expected = {};
    process.domain.rdb = c.expected;
 
    c.returned = require('../getSessionContext')();
    process.domain = oldDomain;
 
}
 
module.exports = act;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionContextSpec/whenGet.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionContextSpec/whenGet.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return context').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionSingletonSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionSingletonSpec/

Statements: 18.75% (3 / 16)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.75% (3 / 16)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/getSessionSingletonSpec/
File Statements Branches Functions Lines
get.js 15.38% (2 / 13) 100% (0 / 0) 0% (0 / 1) 15.38% (2 / 13)
whenGet.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionSingletonSpec/get.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionSingletonSpec/get.js

Statements: 15.38% (2 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 15.38% (2 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 202   1                                  
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.expected = {};
	c.context = {};
	c.context.foo = c.expected;
 
	c.getSessionContext = c.requireMock('./getSessionContext');
	c.getSessionContext.expect().return(c.context);
 
	c.returned = require('../getSessionSingleton')('foo');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionSingletonSpec/whenGet.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/getSessionSingletonSpec/whenGet.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return singleton').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasManySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasManySpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/hasManySpec/
File Statements Branches Functions Lines
whenHasMany.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasManySpec/whenHasMany.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasManySpec/whenHasMany.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should add relation to relations').assertEqual(c.manyRelation,c.parentTable._relations.child)
	.it('should set rightAlias').assertEqual('child', c.joinRelation.rightAlias)
	
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasManySpec/hasMany/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasManySpec/hasMany/

Statements: 37.5% (3 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/hasManySpec/hasMany/
File Statements Branches Functions Lines
getRelatedTable.js 40% (2 / 5) 100% (0 / 0) 0% (0 / 1) 40% (2 / 5)
whenGetRelatedTable.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasManySpec/hasMany/getRelatedTable.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasManySpec/hasMany/getRelatedTable.js

Statements: 40% (2 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 81           1  
function act(c){	
	c.expected = {};
	c.newRelatedTable.expect([c.manyRelation]).return(c.expected);
	c.returned = c.parentTable.child;
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasManySpec/hasMany/whenGetRelatedTable.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasManySpec/hasMany/whenGetRelatedTable.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c).
	it('should return child Table').assertEqual(c.expected,c.returned);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasOneSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasOneSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/hasOneSpec/
File Statements Branches Functions Lines
whenHasOne.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasOneSpec/whenHasOne.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasOneSpec/whenHasOne.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should add oneRelation to relations').assertEqual(c.oneRelation,c.parentTable._relations.child)
	.it('should set rightAlias').assertEqual('child', c.joinRelation.rightAlias)
	
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasOneSpec/hasOne/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasOneSpec/hasOne/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/hasOneSpec/hasOne/
File Statements Branches Functions Lines
whenGetRelatedTable.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasOneSpec/hasOne/whenGetRelatedTable.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/hasOneSpec/hasOne/whenGetRelatedTable.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c).
	it('should return child Table').assertEqual(c.expected,c.returned);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/insertSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/insertSpec/

Statements: 13.33% (2 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 13.33% (2 / 15)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/insertSpec/
File Statements Branches Functions Lines
req.js 13.33% (2 / 15) 100% (0 / 0) 0% (0 / 1) 13.33% (2 / 15)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/insertSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/insertSpec/req.js

Statements: 13.33% (2 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 13.33% (2 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 212     1                                  
var a = require('a');
var requireMock = a.requireMock;
 
function act(c){
	c.mock = a.mock;
	c.newRow = requireMock('./commands/newRow');
	c.newInsertCommand = requireMock('./commands/newInsertCommand');
	c.pushCommand = requireMock('./commands/pushCommand');
 
	c.table = {};
	c.cache = {};
	c.id = 1;
	c.id2 = 'bar';
	c.row = {};
	c.table._cache = c.cache;
 
	c.sut = require('../insert')
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/insertSpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/insertSpec/req/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/insertSpec/req/
File Statements Branches Functions Lines
whenInsert.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/insertSpec/req/whenInsert.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/insertSpec/req/whenInsert.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
	.it('should push insertCommand').assertDoesNotThrow(c.pushCommand.verify)
	.it('should return row').assertEqual(c.row, c.returned)	
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/isDirtySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/isDirtySpec/

Statements: 20% (3 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (3 / 15)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/isDirtySpec/
File Statements Branches Functions Lines
req.js 16.67% (2 / 12) 100% (0 / 0) 0% (0 / 1) 16.67% (2 / 12)
whenReq.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/isDirtySpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/isDirtySpec/req.js

Statements: 16.67% (2 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 192   1                                
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.expected = {};
 
	c.getSessionSingleton = c.requireMock('./getSessionSingleton');
	c.getSessionSingleton.bind = c.mock();
	c.getSessionSingleton.bind.expect(null,'isDirty').return(c.expected);
 
	c.returned = require('../isDirty');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/isDirtySpec/whenReq.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/isDirtySpec/whenReq.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return expected').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/

Statements: 50% (8 / 16)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (8 / 16)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/joinRelation/
File Statements Branches Functions Lines
getRelatives.js 100% (3 / 3) 100% (0 / 0) 100% (0 / 0) 100% (3 / 3)
joinLegToQuery.js 38.46% (5 / 13) 100% (0 / 0) 0% (0 / 1) 38.46% (5 / 13)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/getRelatives.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/getRelatives.js

Statements: 100% (3 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (3 / 3)      Ignored: none     

1 2 3 4 51 1   1  
var legToQuery = require('./joinLegToQuery');
var getRelativesCore = require('../getRelativesCore');
 
module.exports = getRelativesCore.bind(null, legToQuery);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/joinLegToQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/joinLegToQuery.js

Statements: 38.46% (5 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 38.46% (5 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1 1   1                     1  
var newShallowJoinSql = require('../query/addSubQueries/newShallowJoinSql');
var newQuery = require('../newQuery');
var emptyFilter;
 
function joinLegToQuery(queries, parentAlias,leg,legNo,filter, innerJoin, limitQuery) {	
	var childAlias = parentAlias + '_' + legNo;
	var span = leg.span;
	var parentTable = leg.table;	
	var childColumns = span.table._primaryColumns;
	var parentColumns = leg.columns;	 
	var shallowJoin  = newShallowJoinSql(parentTable,childColumns,parentColumns,childAlias,parentAlias,limitQuery);
	innerJoin = shallowJoin.append(innerJoin);	
	return newQuery(queries, span.table,filter,span,childAlias,innerJoin);
}
 
module.exports = joinLegToQuery;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/getRelativesSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/getRelativesSpec/

Statements: 18.75% (3 / 16)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.75% (3 / 16)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/joinRelation/getRelativesSpec/
File Statements Branches Functions Lines
req.js 15.38% (2 / 13) 100% (0 / 0) 0% (0 / 1) 15.38% (2 / 13)
whenReq.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/getRelativesSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/getRelativesSpec/req.js

Statements: 15.38% (2 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 15.38% (2 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 212   1                                    
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.expected = {};
 
	c.legToQuery = c.requireMock('./joinLegToQuery');	
	c.getRelativesCore = c.requireMock('../getRelativesCore');
 
	c.getRelativesCore.bind = c.mock();
	c.getRelativesCore.bind.expect(null, c.legToQuery).return(c.expected);	
 
	c.sut = require('../getRelatives');	
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/getRelativesSpec/whenReq.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/getRelativesSpec/whenReq.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return bound getRelativesCore').assertEqual(c.expected, c.sut)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/joinLegToQuerySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/joinLegToQuerySpec/

Statements: 12.5% (1 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 12.5% (1 / 8)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/joinRelation/joinLegToQuerySpec/
File Statements Branches Functions Lines
req.js 12.5% (1 / 8) 100% (0 / 0) 0% (0 / 1) 12.5% (1 / 8)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/joinLegToQuerySpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinRelation/joinLegToQuerySpec/req.js

Statements: 12.5% (1 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 12.5% (1 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 132                        
var a = require('a');
var requireMock = a.requireMock;
var mock = a.mock;
 
module.exports = function(c) {
	c.mock = mock;
	c.newShallowJoinSql = requireMock('../query/addSubQueries/newShallowJoinSql');
 
	c.newQuery = requireMock('../newQuery');
	c.sut = require('../joinLegToQuery');
}
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinSpec/

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/joinSpec/
File Statements Branches Functions Lines
req.js 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinSpec/req.js

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 282   1                                                  
var requireMock = require('a').requireMock;
 
function act(c) {	
	c.newRelatedTable = requireMock('./newRelatedTable');
	c.newJoinRelation = requireMock('./newJoinRelation');
	c.foo = {
		alias: 'fooProp',
		_dbName: 'foo'
	};
	c.bar = {
		alias: 'barProp',
		_dbName: 'bar'
	};
	c.baz = {
		alias: 'bazProp',
		_dbName: 'baz'
	};
	c.parentTable = {
		_columns: [c.foo, c.bar, c.baz],
		_relations: {}
	};
 
	c.childTable = {};
	c.sut = require('../join');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinSpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinSpec/req/

Statements: 33.33% (4 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 33.33% (4 / 12)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/joinSpec/req/
File Statements Branches Functions Lines
joinUnknownColumn.js 33.33% (2 / 6) 100% (0 / 0) 0% (0 / 1) 33.33% (2 / 6)
whenJoin.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenJoinUnknownColumn.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinSpec/req/joinUnknownColumn.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinSpec/req/joinUnknownColumn.js

Statements: 33.33% (2 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 33.33% (2 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131                     1  
function act(c) {	
	c.joinRelation = {};
 
	try {
		c.sut(c.parentTable, c.childTable).by('foo','someColumn').by('bar').as('child');		
	}
	catch (e) {
		c.thrownMessage = e.message;
	}
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinSpec/req/whenJoin.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinSpec/req/whenJoin.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
    .it('should return joinRelation').assertEqual(c.joinRelation, c.returned)
    .it('should add joinRelation to relations').assertEqual(c.joinRelation, c.parentTable._relations.child)
    .it('should set leftAlias on relation').assertEqual('child', c.joinRelation.leftAlias)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinSpec/req/whenJoinUnknownColumn.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/joinSpec/req/whenJoinUnknownColumn.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
    .it('should throw with unknown column name').assertEqual('Unknown column: someColumn', c.thrownMessage)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/logSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/logSpec/

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/logSpec/
File Statements Branches Functions Lines
req.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/logSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/logSpec/req.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 142   1                      
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
 
	c.sut = require('../log');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/logSpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/logSpec/req/

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/logSpec/req/
File Statements Branches Functions Lines
registerLogger.js 50% (2 / 4) 100% (0 / 0) 0% (0 / 1) 50% (2 / 4)
whenLog.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/logSpec/req/registerLogger.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/logSpec/req/registerLogger.js

Statements: 50% (2 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (2 / 4)      Ignored: none     

1 2 3 4 5 6 71         1  
function act(c){
	c.logger = c.mock();
	c.sut.registerLogger(c.logger);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/logSpec/req/whenLog.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/logSpec/req/whenLog.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should not do anything').assertOk(true);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/

Statements: 14.29% (2 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 14.29% (2 / 14)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/
File Statements Branches Functions Lines
req.js 14.29% (2 / 14) 100% (0 / 0) 0% (0 / 2) 14.29% (2 / 14)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/req.js

Statements: 14.29% (2 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 14.29% (2 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 222   1                                      
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
 
	c.relation = {};
	c.parent = {};
	c.child = {};
	c.children = [c.child, {}, {}];
 
	c.sut = require('../negotiateExpandInverse');
 
	c.negotiate = function() {
		c.sut(c.parent, c.relation, c.children);
	}
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isHasRelation/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isHasRelation/

Statements: 28.57% (6 / 21)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 28.57% (6 / 21)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isHasRelation/
File Statements Branches Functions Lines
negotiate.js 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
negotiateNoChildren.js 33.33% (2 / 6) 100% (0 / 0) 0% (0 / 1) 33.33% (2 / 6)
whenNegotiate.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenNegotiateNoChildren.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isHasRelation/negotiate.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isHasRelation/negotiate.js

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141                       1  
function act(c){		
	c.joinRelation = {};
	c.queryContext = {};
	c.child.queryContext = c.queryContext;
	c.relation.joinRelation = c.joinRelation;
 
	c.child.queryContext.expand = c.mock();
	c.child.queryContext.expand.expect(c.joinRelation);
 
	c.negotiate();
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isHasRelation/negotiateNoChildren.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isHasRelation/negotiateNoChildren.js

Statements: 33.33% (2 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 33.33% (2 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 91             1  
function act(c){		
	c.joinRelation = {};
	c.relation.joinRelation = c.joinRelation;
	c.children = [];
	c.negotiate();
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isHasRelation/whenNegotiate.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isHasRelation/whenNegotiate.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should expand inverse relation').assertDoesNotThrow(c.queryContext.expand.verify)
	
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isHasRelation/whenNegotiateNoChildren.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isHasRelation/whenNegotiateNoChildren.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should not crash').assertOk(true)
	
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isJoinRelation/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isJoinRelation/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isJoinRelation/
File Statements Branches Functions Lines
whenNegotiate.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isJoinRelation/whenNegotiate.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/negotiateExpandInverseSpec/isJoinRelation/whenNegotiate.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should not crash').assertOk(true)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
	.it('should set subscribeAdded to emitAdded.add').assertEqual(c.emitAdded.add, c.sut.subscribeAdded)
	.it('should set subscribeRemoved to emitRemoved.add').assertEqual(c.emitRemoved.add, c.sut.subscribeRemoved)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/

Statements: 51.85% (14 / 27)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 51.85% (14 / 27)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/
File Statements Branches Functions Lines
getAll.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
tryGet.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
tryRemoveCached.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
whenAdd.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenGetAll.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenTryGet.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenTryRemove.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenTryRemoveCached.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/getAll.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/getAll.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 81 1         1  
var parentRow = {};
function act(c){
	
	c.returned = c.sut.getAll();
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/tryGet.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/tryGet.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 81 1         1  
var parentRow = {};
function act(c){
	
	c.returned = c.sut.tryGet([1,2]);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/tryRemoveCached.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/tryRemoveCached.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 81 1         1  
var parentRow = {};
function act(c){
	
	c.returned = c.sut.tryGet([1,2]);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/whenAdd.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/whenAdd.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return value').assertEqual(c.result, c.returned)
	.it('should emit added').assertDoesNotThrow(c.emitAdded.verify)	
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/whenGetAll.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/whenGetAll.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return empty array').assertDeepEqual([], c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/whenTryGet.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/whenTryGet.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return null').assertStrictEqual(null, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/whenTryRemove.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/whenTryRemove.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return null').assertStrictEqual(null, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/whenTryRemoveCached.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCacheSpec/new/whenTryRemoveCached.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return null').assertStrictEqual(null, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCascadeDeleteStrategySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCascadeDeleteStrategySpec/

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newCascadeDeleteStrategySpec/
File Statements Branches Functions Lines
req.js 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCascadeDeleteStrategySpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCascadeDeleteStrategySpec/req.js

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 152   1                        
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
 
	c.newObject = c.requireMock('../newObject');	
	
	c.sut = require('../newCascadeDeleteStrategy');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCascadeDeleteStrategySpec/req/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCascadeDeleteStrategySpec/req/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newCascadeDeleteStrategySpec/req/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCascadeDeleteStrategySpec/req/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newCascadeDeleteStrategySpec/req/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should add sub strategies').assertDoesNotThrow(c.newNextCascadeDeleteStrategy.verify)
	.it('should return strategy').assertEqual(c.strategy, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/

Statements: 31.25% (10 / 32)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 31.25% (10 / 32)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/
File Statements Branches Functions Lines
subscribeAdded.js 28.57% (2 / 7) 100% (0 / 0) 0% (0 / 1) 28.57% (2 / 7)
subscribeRemoved.js 28.57% (2 / 7) 100% (0 / 0) 0% (0 / 1) 28.57% (2 / 7)
whenAdd.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenGetAll.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenRemove.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenSubscribeAdded.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenSubscribeRemoved.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenTryGet.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/subscribeAdded.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/subscribeAdded.js

Statements: 28.57% (2 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 28.57% (2 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121                   1  
function act(c){
	c.stubCache();
 
	c.cb = {};
	c.cache.subscribeAdded = c.mock();
	c.cache.subscribeAdded.expect(c.cb);
 
	c.sut.subscribeAdded(c.cb);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/subscribeRemoved.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/subscribeRemoved.js

Statements: 28.57% (2 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 28.57% (2 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121                   1  
function act(c){
	c.stubCache();
 
	c.cb = {};
	c.cache.subscribeRemoved = c.mock();
	c.cache.subscribeRemoved.expect(c.cb);
 
	c.sut.subscribeRemoved(c.cb);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/whenAdd.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/whenAdd.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 102                  
var when = require('a').when;
var c = {};
 
when(c)
	.it('should add to cache').assertDoesNotThrow(c.cache.tryAdd.verify)
	.it('should return cached').assertEqual(c.expected, c.returned)
	
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/whenGetAll.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/whenGetAll.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return from cache').assertEqual(c.expected, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/whenRemove.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/whenRemove.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
	.it('should remove from cache').assertDoesNotThrow(c.cache.tryRemove.verify)
	
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/whenSubscribeAdded.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/whenSubscribeAdded.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should subscribe to added').assertDoesNotThrow(c.cache.subscribeAdded.verify)	
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/whenSubscribeRemoved.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/whenSubscribeRemoved.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should subscribe to removed').assertDoesNotThrow(c.cache.subscribeRemoved.verify)	
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/whenTryGet.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newDomainCacheSpec/new/whenTryGet.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return from cache').assertEqual(c.expected, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newGetRelatedSpec/expanded/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newGetRelatedSpec/expanded/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newGetRelatedSpec/expanded/
File Statements Branches Functions Lines
whenGet.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newGetRelatedSpec/expanded/whenGet.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newGetRelatedSpec/expanded/whenGet.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
    .it('should return related row').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 132                        
var when = require('a').when;
var c = {};
 
when(c)
	.it('should have two columns').assertEqual(2,c.sut.columns.length)
	.it('should have fooColumn').assertEqual(c.fooColumn,c.sut.columns[0])
	.it('should have barColumn').assertEqual(c.barColumn,c.sut.columns[1])
	.it('should have parentTable').assertEqual(c.parentTable,c.sut.parentTable)
	.it('should have childTable').assertEqual(c.childTable,c.sut.childTable)
	.it('should set getFromCache to getFromDb').assertEqual(c.sut.getFromDb, c.sut.getFromCache)
	
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/

Statements: 37.5% (15 / 40)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 37.5% (15 / 40)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/
File Statements Branches Functions Lines
expand.js 25% (2 / 8) 100% (0 / 0) 0% (0 / 1) 25% (2 / 8)
toGetRelated.js 33.33% (2 / 6) 100% (0 / 0) 0% (0 / 1) 33.33% (2 / 6)
toLeg.js 54.55% (6 / 11) 100% (0 / 0) 0% (0 / 1) 54.55% (6 / 11)
whenAccept.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenExpand.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenGetRelatives.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenToGetRelated.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenToLeg.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/expand.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/expand.js

Statements: 25% (2 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111                 1  
function act(c) {
	c.parentRow = {};
	c.parentRow.expand = c.mock();
	c.alias = {};
	c.sut.leftAlias = c.alias;
	c.parentRow.expand.expect(c.alias);
	c.sut.expand(c.parentRow);
} 
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/toGetRelated.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/toGetRelated.js

Statements: 33.33% (2 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 33.33% (2 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 91             1  
function act(c){
	c.parent = {};
	c.expected = {};
	c.newGetRelated.expect(c.parent, c.sut).return(c.expected);
	c.returned = c.sut.toGetRelated(c.parent);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/toLeg.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/toLeg.js

Statements: 54.55% (6 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 54.55% (6 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1 1   1               1 1  
var newLeg;
var leg = {};
var sut;
 
function act(c){
	newLeg = c.newLeg;
	sut = c.sut;	
	newLeg.expect(sut).return(leg);
	c.leg = leg;
	c.returned = sut.toLeg();
}
 
act.base = '../new'
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/whenAccept.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/whenAccept.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c).
	it('should visit join').assertDoesNotThrow(c.visitor.visitJoin.verify);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/whenExpand.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/whenExpand.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should expand parent').assertDoesNotThrow(c.parentRow.expand.verify)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/whenGetRelatives.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/whenGetRelatives.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
.it('should return relatives').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/whenToGetRelated.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/whenToGetRelated.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
.it('should return toGetRelated').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/whenToLeg.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newJoinRelationSpec/new/whenToLeg.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c).
	it('should return leg').assertEqual(c.leg,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
    .it('should have joinRelation').assertEqual(c.joinRelation, c.sut.joinRelation)
    .it('should set childTable').assertEqual(c.childTable, c.sut.childTable)
    .it('should set getRowsSync to cache.tryGet').assertEqual(c.cache.tryGet, c.sut.getRowsSync)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/

Statements: 33.33% (13 / 39)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 33.33% (13 / 39)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/
File Statements Branches Functions Lines
getFromCache.js 37.5% (3 / 8) 100% (0 / 0) 0% (0 / 1) 37.5% (3 / 8)
getFromDb.js 30% (3 / 10) 100% (0 / 0) 0% (0 / 1) 30% (3 / 10)
whenAccept.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenExpand.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenGetFromCache.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenGetFromDb.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenGetRelatives.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenToGetRelated.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenToLeg.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/getFromCache.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/getFromCache.js

Statements: 37.5% (3 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111   1             1  
var parentRow = {};
 
function act(c){	
	c.cachedResult = {};
	c.expected = {};
	c.resultToPromise.expect(c.cachedResult).return(c.expected);
	c.cache.tryGet.expect(parentRow).return(c.cachedResult);
	c.returned = c.sut.getFromCache(parentRow);
}
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/getFromDb.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/getFromDb.js

Statements: 30% (3 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 30% (3 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161   1                       1  
var parentRow = {};
 
function act(c){	
	c.result = 'res';
 
	c.foreignKeyFilter = {};
	c.newForeignKeyFilter.expect(c.joinRelation, parentRow).return(c.foreignKeyFilter);
 
	c.expected = {};
	c.childTable.getMany = c.mock();
	c.childTable.getMany.expect(c.foreignKeyFilter).return(c.expected);
 
	c.returned = c.sut.getFromDb(parentRow);
}
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/whenAccept.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/whenAccept.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
.it('should visitMany').assertDoesNotThrow(c.visitor.visitMany.verify);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/whenExpand.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/whenExpand.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should expand parent').assertDoesNotThrow(c.parentRow.expand.verify)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/whenGetFromCache.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/whenGetFromCache.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return cached result').assertEqual(c.expected, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/whenGetFromDb.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/whenGetFromDb.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
    .it('should return result from db').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/whenGetRelatives.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/whenGetRelatives.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return result').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/whenToGetRelated.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/whenToGetRelated.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return getRelated').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/whenToLeg.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newManyRelationSpec/new/whenToLeg.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c).
	it('should return leg').assertEqual(c.leg,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should have joinRelation').assertEqual(c.joinRelation, c.sut.joinRelation)
	.it('should set childTable').assertEqual(c.childTable, c.sut.childTable)
    .it('should set getRowsSync to oneCache.tryGet').assertEqual(c.oneCache.tryGet, c.sut.getRowsSync)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/

Statements: 33.33% (7 / 21)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (7 / 21)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/
File Statements Branches Functions Lines
whenAccept.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenExpand.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenGetFromCache.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenGetFromDb.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenGetRelatives.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenToGetRelated.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenToLeg.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/whenAccept.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/whenAccept.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
.it('should visitOne').assertDoesNotThrow(c.visitor.visitOne.verify);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/whenExpand.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/whenExpand.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should expand parent').assertDoesNotThrow(c.parentRow.expand.verify)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/whenGetFromCache.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/whenGetFromCache.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return cached result').assertEqual(c.expected, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/whenGetFromDb.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/whenGetFromDb.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
    .it('should return result from db').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/whenGetRelatives.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/whenGetRelatives.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return result').assertEqual(c.expected, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/whenToGetRelated.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/whenToGetRelated.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return getRelated').assertEqual(c.expected, c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/whenToLeg.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newOneRelationSpec/new/whenToLeg.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c).
	it('should return leg').assertEqual(c.leg,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newPrimaryKeyFilterSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newPrimaryKeyFilterSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newPrimaryKeyFilterSpec/
File Statements Branches Functions Lines
when_new.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newPrimaryKeyFilterSpec/when_new.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newPrimaryKeyFilterSpec/when_new.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when('./new',c)
	.it('should return filter').assertDeepEqual(c.filter,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newQuerySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newQuerySpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newQuerySpec/
File Statements Branches Functions Lines
when_new.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newQuerySpec/when_new.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newQuerySpec/when_new.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
	.it('should push singleQuery to queries').assertDoesNotThrow(c.queries.push.verify)
	.it('should addSubQueries').assertDoesNotThrow(c.addSubQueries.verify)
	.it('should set limitQuery on queryContext').assertEqual(c.limitQuery, c.singleQuery.queryContext.limitQuery)	
	.it('returns queries').assertEqual(c.queries,c.returned)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRelatedTableSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRelatedTableSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newRelatedTableSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRelatedTableSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRelatedTableSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 102                  
var when = require('a').when;
var c = {};
 
when(c)
	.it('should have related column a').assertEqual(c.a,c.sut.a)
	.it('should have related column b').assertEqual(c.b,c.sut.b)
	.it('exists returns existsFilter').assertEqual(c.existsFilter,c.sut.exists())
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRelatedTableSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRelatedTableSpec/new/

Statements: 25% (3 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 25% (3 / 12)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newRelatedTableSpec/new/
File Statements Branches Functions Lines
getRelatedTables.js 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
whenGetRelatedTables.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRelatedTableSpec/new/getRelatedTables.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRelatedTableSpec/new/getRelatedTables.js

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151                         1  
function act(c){
	c.childTable = 'childT';
	c.childTable2 = 'childT2';
	
	c.newRelatedTable = c.requireMock('./newRelatedTable');	
 
	c.newRelatedTable.expect([c.relation, c.relation2, c.childRelation]).return(c.childTable);	
	c.newRelatedTable.expect([c.relation, c.relation2, c.childRelation2]).return(c.childTable2);	
	
	c.returnedChild = c.sut.child;
	c.returnedChild2 = c.sut.child2;
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRelatedTableSpec/new/whenGetRelatedTables.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRelatedTableSpec/new/whenGetRelatedTables.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return child table').assertEqual(c.childTable, c.returnedChild)
	.it('should return child table2').assertEqual(c.childTable2, c.returnedChild2)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 102                  
var when = require('a').when;
var c = {};
 
when(c)
	.it('getAll points to domainCache.getAll ').assertEqual(c.domainCache.getAll, c.sut.getAll)
	.it('should set subscribeAdded point to domainCache.subscribeAdded').assertEqual(c.domainCache.subscribeAdded, c.sut.subscribeAdded)
	.it('should set subscribeRemoved point to domainCache.subscribeRemoved').assertEqual(c.domainCache.subscribeRemoved, c.sut.subscribeRemoved)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/new/

Statements: 33.33% (3 / 9)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (3 / 9)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/new/
File Statements Branches Functions Lines
whenAdd.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenRemove.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenTryGet.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/new/whenAdd.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/new/whenAdd.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
	.it('should add to domainCache').assertDoesNotThrow(c.domainCache.tryAdd.verify)
	.it('should return row').assertEqual(c.expected, c.returned)	
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/new/whenRemove.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/new/whenRemove.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should remove from domainCache').assertDoesNotThrow(c.domainCache.tryRemove.verify)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/new/whenTryGet.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newRowCacheSpec/new/whenTryGet.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return from domainCache').assertEqual(c.expected, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newThrowSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newThrowSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/newThrowSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newThrowSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/newThrowSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
    .it('should return promise').assertEqual(c.expected, c.returned)
    .it('should try relase dbClient').assertDoesNotThrow(c.tryReleaseDbClient.verify)
    .it('should throw received error on success').assertEqual(c.error, c.thrownError)
    .it('should throw received error on failure').assertEqual(c.throwFunc, c.throwFunc2)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/notifyDirtySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/notifyDirtySpec/

Statements: 23.08% (3 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/notifyDirtySpec/
File Statements Branches Functions Lines
notify.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
whenNotify.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/notifyDirtySpec/notify.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/notifyDirtySpec/notify.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 152   1                        
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.setSessionSingleton = c.requireMock('./setSessionSingleton');
	c.setSessionSingleton.expect('isDirty', true);		
	require('../notifyDirty')();
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/notifyDirtySpec/whenNotify.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/notifyDirtySpec/whenNotify.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should set session singleton').assertDoesNotThrow(c.setSessionSingleton.verify)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/nullPromiseSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/nullPromiseSpec/

Statements: 23.08% (3 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/nullPromiseSpec/
File Statements Branches Functions Lines
req.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
whenReq.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/nullPromiseSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/nullPromiseSpec/req.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 142       1                  
var a = require('a');
var requireMock = a.requireMock;
var mock = a.mock;
 
function act(c) {
	c.newPromise = mock();
	c.expected = {};
	c.newPromise = requireMock('./promise');
	c.newPromise.expect(null).return(c.expected);
	c.returned = require('../nullPromise');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/nullPromiseSpec/whenReq.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/nullPromiseSpec/whenReq.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
	.it('returns nullPromise').assertEqual(c.expected, c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/objectToCallbackSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/objectToCallbackSpec/

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/objectToCallbackSpec/
File Statements Branches Functions Lines
whenToCallback.js 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/objectToCallbackSpec/whenToCallback.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/objectToCallbackSpec/whenToCallback.js

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 172         1                      
var a = require('a');
var mock = a.mock;
var when = a.when;
var c = {};
 
function act(c) {
	c.object = {};
	c.sut = require('../objectToCallback')(c.object);
	c.onResolve = mock();
	c.onResolve.expect(c.object);
	c.sut(c.onResolve);
}
 
when(act,c).
	it('should invoke with object').assertDoesNotThrow(c.onResolve.verify);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/oneRelation/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/oneRelation/

Statements: 100% (3 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (3 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/oneRelation/
File Statements Branches Functions Lines
getRelatives.js 100% (3 / 3) 100% (0 / 0) 100% (0 / 0) 100% (3 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/oneRelation/getRelatives.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/oneRelation/getRelatives.js

Statements: 100% (3 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (3 / 3)      Ignored: none     

1 2 3 4 51 1   1  
var legToQuery = require('../query/addSubQueries/manyLegToQuery');
var getRelativesCore = require('../getRelativesCore');
 
module.exports = getRelativesCore.bind(null, legToQuery);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/oneRelation/getRelativesSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/oneRelation/getRelativesSpec/

Statements: 18.75% (3 / 16)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.75% (3 / 16)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/oneRelation/getRelativesSpec/
File Statements Branches Functions Lines
req.js 15.38% (2 / 13) 100% (0 / 0) 0% (0 / 1) 15.38% (2 / 13)
whenReq.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/oneRelation/getRelativesSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/oneRelation/getRelativesSpec/req.js

Statements: 15.38% (2 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 15.38% (2 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 212   1                                    
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.expected = {};
 
	c.legToQuery = c.requireMock('../query/addSubQueries/manyLegToQuery');	
	c.getRelativesCore = c.requireMock('../getRelativesCore');
 
	c.getRelativesCore.bind = c.mock();
	c.getRelativesCore.bind.expect(null, c.legToQuery).return(c.expected);	
 
	c.sut = require('../getRelatives');	
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/oneRelation/getRelativesSpec/whenReq.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/oneRelation/getRelativesSpec/whenReq.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return bound getRelativesCore').assertEqual(c.expected, c.sut)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/
File Statements Branches Functions Lines
req.js 18.18% (2 / 11) 100% (0 / 0) 0% (0 / 1) 18.18% (2 / 11)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/req.js

Statements: 18.18% (2 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 152         1                  
var a = require('a');
var mock = a.mock;
var requireMock = a.requireMock;
var expectRequire = a.expectRequire;
 
function act(c){
	c.mock = mock;		
	c.changeSetId = 'cid';
	c.getChangeSet = requireMock('./commands/getChangeSet');
	c.compressChanges = requireMock('./commands/compressChanges');
	c.sut = require('../popChanges');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/empty/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/empty/

Statements: 37.5% (3 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/empty/
File Statements Branches Functions Lines
pop.js 40% (2 / 5) 100% (0 / 0) 0% (0 / 1) 40% (2 / 5)
whenPop.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/empty/pop.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/empty/pop.js

Statements: 40% (2 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 81           1  
function act(c){
	c.changeSet = [];
	c.getChangeSet.expect().return(c.changeSet);
	c.returned = c.sut();
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/empty/whenPop.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/empty/whenPop.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return changeSet').assertEqual(c.changeSet, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/notEmpty/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/notEmpty/

Statements: 26.67% (4 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 26.67% (4 / 15)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/notEmpty/
File Statements Branches Functions Lines
popWithoutEndEdit.js 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
whenPop.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenPopWithoutEndEdit.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/notEmpty/popWithoutEndEdit.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/notEmpty/popWithoutEndEdit.js

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 141                       1  
function act(c){
	c.firstCommand = {};
	c.lastCommand = {};
	c.changeSet = [c.firstCommand, c.lastCommand];
	c.expected = {};
 
	c.getChangeSet.expect().return(c.changeSet);
	c.compressChanges.expect(c.changeSet).return(c.expected);
	
	c.returned = c.sut();
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/notEmpty/whenPop.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/notEmpty/whenPop.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 102                  
var when = require('a').when;
var c = {};
 
when(c)
	.it('should end edit last Command').assertDoesNotThrow(c.lastCommand.endEdit.verify)
	.it('should return compressed changeSet').assertEqual(c.expected, c.returned)
	.it('should set clear changeSet').assertDeepEqual(0, c.changeSet.length)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/notEmpty/whenPopWithoutEndEdit.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/popChangesSpec/notEmpty/whenPopWithoutEndEdit.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return compressed changeSet').assertEqual(c.expected, c.returned)
	.it('should clear changeSet').assertDeepEqual(0, c.changeSet.length)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/

Statements: 40% (50 / 125)      Branches: 9.09% (2 / 22)      Functions: 13.04% (3 / 23)      Lines: 40% (50 / 125)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/query/
File Statements Branches Functions Lines
addSubQueries.js 33.33% (9 / 27) 100% (0 / 0) 0% (0 / 8) 33.33% (9 / 27)
extractFilter.js 50% (3 / 6) 0% (0 / 2) 0% (0 / 1) 50% (3 / 6)
extractLimit.js 40% (2 / 5) 0% (0 / 2) 0% (0 / 1) 40% (2 / 5)
extractLimitQuery.js 45.45% (5 / 11) 0% (0 / 2) 0% (0 / 1) 45.45% (5 / 11)
extractOrderBy.js 16% (4 / 25) 0% (0 / 10) 0% (0 / 3) 16% (4 / 25)
extractSql.js 100% (5 / 5) 100% (2 / 2) 100% (1 / 1) 100% (5 / 5)
newParameterized.js 54.17% (13 / 24) 0% (0 / 4) 33.33% (2 / 6) 54.17% (13 / 24)
newSingleQuery.js 40.91% (9 / 22) 100% (0 / 0) 0% (0 / 2) 40.91% (9 / 22)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/addSubQueries.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/addSubQueries.js

Statements: 33.33% (9 / 27)      Branches: 100% (0 / 0)      Functions: 0% (0 / 8)      Lines: 33.33% (9 / 27)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 461 1 1   1                                 1           1         1         1             1  
var joinLegToQuery = _joinLegToQuery;
var oneLegToQuery = _oneLegToQuery;
var manyLegToQuery = _manyLegToQuery;
 
function addSubQueries(queries,table,filter,span,alias,innerJoin) {	
	var c = {};
	var _legNo;
	var limitQuery = queries[queries.length-1].queryContext.limitQuery;
 
	c.visitJoin = function(leg) {
		joinLegToQuery(queries, alias,leg,_legNo,filter,innerJoin, limitQuery);
	};
	c.visitOne = function(leg) {
		oneLegToQuery(queries, alias,leg,_legNo,filter,innerJoin, limitQuery);
	};
	c.visitMany = function(leg) {
		manyLegToQuery(queries, alias,leg,_legNo,filter,innerJoin, limitQuery);
	};
 
	span.legs.forEach(onEachLeg);	
 
	function onEachLeg(leg,legNo) {
		_legNo = legNo;
		leg.accept(c);
	}
}
 
function _joinLegToQuery() {
	joinLegToQuery = require('./addSubQueries/joinLegToQuery');	
	return joinLegToQuery.apply(null,arguments);
}
 
function _oneLegToQuery() {
	oneLegToQuery = require('./addSubQueries/oneLegToQuery');	
	return oneLegToQuery.apply(null,arguments);
}
 
function _manyLegToQuery() {
	manyLegToQuery = require('./addSubQueries/manyLegToQuery');	
	return manyLegToQuery.apply(null,arguments);
}
 
 
 
module.exports = addSubQueries;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractFilter.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractFilter.js

Statements: 50% (3 / 6)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 101   1           1  
var emptyFilter = require('../../emptyFilter');
 
function extract(filter) {
	if (filter)
		return filter;
	return emptyFilter;
}
 
module.exports = extract;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractLimit.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractLimit.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 91             1  
function extractLimit(span) {
	if (span.limit) {
		return ' limit ' + span.limit;
	}
	return '';
}
 
module.exports = extractLimit;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractLimitQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractLimitQuery.js

Statements: 45.45% (5 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 45.45% (5 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1 1   1                   1    
var newWhereSql = require('./singleQuery/newWhereSql');
var negotiateLimit = require('./singleQuery/negotiateLimit');
var newParameterized = require('./newParameterized');
 
function _new(table, filter, span, alias, orderBy, limit) {
    if (!limit)
        return;
    var whereSql = newWhereSql(table, filter, alias);
    var safeLimit = negotiateLimit(limit);
    var sql = 'select * from ' + table._dbName + ' ' + alias + whereSql + orderBy + safeLimit;
 
    return newParameterized(sql, filter.parameters);
}
 
module.exports = _new;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractOrderBy.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractOrderBy.js

Statements: 16% (4 / 25)      Branches: 0% (0 / 10)      Functions: 0% (0 / 3)      Lines: 16% (4 / 25)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 421                                     1                     1                 1    
function extractOrderBy(table, alias, orderBy, originalOrderBy) {
    var dbNames = [];
    var i;
    if (orderBy) {
        if (typeof orderBy === 'string')
            orderBy = [orderBy];
        for (i = 0; i < orderBy.length; i++) {
            var nameAndDirection = extractNameAndDirection(orderBy[i]);
            pushColumn(nameAndDirection.name, nameAndDirection.direction);
        }
    } else {
        if(originalOrderBy)
            return originalOrderBy;
 
        for (i = 0; i < table._primaryColumns.length; i++) {
            pushColumn(table._primaryColumns[i].alias);
        }
    }
 
    function extractNameAndDirection(orderBy) {
        var elements = orderBy.split(' ');
        var direction = '';
        if (elements.length > 1) {
            direction = ' ' + elements[1];
        }
        return {
            name: elements[0],
            direction: direction
        };
    }
    function pushColumn(property, direction) {
        direction = direction || '';
        var column = table[property];
        dbNames.push(alias + '.' + column._dbName + direction);
    }
 
    return ' order by ' + dbNames.join(',');
}
 
module.exports = extractOrderBy;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractSql.js

Statements: 100% (5 / 5)      Branches: 100% (2 / 2)      Functions: 100% (1 / 1)      Lines: 100% (5 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 91 5 3 2     1    
function extract(sql) {
	if (sql)
		return sql;
	return '';
}
 
module.exports = extract;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/newParameterized.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/newParameterized.js

Statements: 54.17% (13 / 24)      Branches: 0% (0 / 4)      Functions: 33.33% (2 / 6)      Lines: 54.17% (13 / 24)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 401 1   1         1 5 5     1       1               1               1 5 5 5      
var extractSql = require('./extractSql');
var extractParameters = require('./parameterized/extractParameters');
 
var nextParameterized = function(text, params) {
    nextParameterized = require('../query/newParameterized');
    return nextParameterized(text, params);
}
 
function Parameterized(text, parameters) {
    this._text = text;
    this.parameters = parameters;
}
 
Parameterized.prototype.sql = function() {
    return this._text;
};
 
Parameterized.prototype.prepend = function(other) {
    if (other.sql) {
        var params = other.parameters.concat(this.parameters);
        return nextParameterized(other.sql() + this._text, params);
    } else
        return nextParameterized(other + this._text, this.parameters);
};
 
Parameterized.prototype.append = function(other) {
    if (other.sql) {        
        var params = this.parameters.concat(other.parameters);
        return nextParameterized(this._text + other.sql(), params);
    } else
        return nextParameterized(this._text + other, this.parameters);
};
 
module.exports = function(text, parameters) {
    text = extractSql(text);
    parameters = extractParameters(parameters);
    return new Parameterized(text, parameters);
};
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/newSingleQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/newSingleQuery.js

Statements: 40.91% (9 / 22)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 40.91% (9 / 22)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 301 1 1 1 1 1 1   1                                       1  
var newColumnSql = require('./singleQuery/newColumnSql');
var newJoinSql = require('./singleQuery/newJoinSql');
var newWhereSql = require('./singleQuery/newWhereSql');
var newQueryContext = require('./singleQuery/newQueryContext');
var negotiateLimit = require('./singleQuery/negotiateLimit');
var negotiateExclusive = require('./singleQuery/negotiateExclusive');
var extractLimitQuery = require('./extractLimitQuery');
 
function _new(table,filter,span,alias,innerJoin,orderBy,limit,exclusive) {
	var c = {};
 
	c.sql = function() {
		var name = table._dbName;
		var columnSql = newColumnSql(table,span,alias);
		var innerJoinSql = innerJoin.sql();
		var joinSql = newJoinSql(span,alias);
		var whereSql = newWhereSql(table,filter,alias);
		var safeLimit = negotiateLimit(limit);
		var exclusiveClause = negotiateExclusive(table,alias,exclusive);
		return 'select ' + columnSql + ' from ' + name + ' ' + alias + innerJoinSql + joinSql + whereSql + orderBy + safeLimit + exclusiveClause;
	};
 
	c.parameters = innerJoin.parameters.concat(filter.parameters);
	c.queryContext = newQueryContext(filter, alias, innerJoin);
 
	return c;
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/addSubQueries/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/addSubQueries/

Statements: 38.78% (19 / 49)      Branches: 0% (0 / 4)      Functions: 0% (0 / 5)      Lines: 38.78% (19 / 49)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/query/addSubQueries/
File Statements Branches Functions Lines
manyLegToQuery.js 40% (6 / 15) 100% (0 / 0) 0% (0 / 1) 40% (6 / 15)
negotiateLimitFilter.js 25% (2 / 8) 0% (0 / 2) 0% (0 / 1) 25% (2 / 8)
newShallowJoinSql.js 41.67% (5 / 12) 0% (0 / 2) 0% (0 / 2) 41.67% (5 / 12)
oneLegToQuery.js 42.86% (6 / 14) 100% (0 / 0) 0% (0 / 1) 42.86% (6 / 14)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/addSubQueries/manyLegToQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/addSubQueries/manyLegToQuery.js

Statements: 40% (6 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 40% (6 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201 1 1 1   1                         1  
var newShallowJoinSql = require('./newShallowJoinSql');
var newQuery = require('../../newQuery');
var newParameterized = require('../newParameterized');
var extractOrderBy = require('../extractOrderBy');
 
function manyLegToQuery(queries, rightAlias,leg,legNo,filter,innerJoin,limitQuery) {	
	var leftAlias = rightAlias + '_' + legNo;
	var span = leg.span;
	var rightTable = leg.table;
	var rightColumns = rightTable._primaryColumns;
	var leftColumns = leg.columns;
	var orderBy = extractOrderBy(span.table, leftAlias, span.orderBy);
	 
	var shallowJoin  = newShallowJoinSql(rightTable,leftColumns,rightColumns,leftAlias,rightAlias,limitQuery);
	innerJoin = shallowJoin.append(innerJoin);	
	return newQuery(queries, span.table,filter,span,leftAlias,innerJoin,orderBy);
}
 
module.exports = manyLegToQuery;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/addSubQueries/negotiateLimitFilter.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/addSubQueries/negotiateLimitFilter.js

Statements: 25% (2 / 8)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 25% (2 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 122   1                  
var newJoinCore = require('./newShallowJoinSqlCore');
 
function negotiateLimitFilter(filter,limit,rightTable,leftColumns,rightColumns,leftAlias,rightAlias) {
	if (!limit)	
		return filter;
	var sql = 'exists (' + rightTable._dbName + ' ' +  rightAlias + ' ON (';
	sql += newJoinCore(rightTable,leftColumns,rightColumns,leftAlias,rightAlias) + ')';
	return sql;
}
 
module.exports = negotiateLimitFilter;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/addSubQueries/newShallowJoinSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/addSubQueries/newShallowJoinSql.js

Statements: 41.67% (5 / 12)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 41.67% (5 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191 1   1           1               1  
var newJoinCore = require('../singleQuery/joinSql/newShallowJoinSqlCore');
var newParameterized = require('../newParameterized');
 
function newShallowJoinSql(rightTable,leftColumns,rightColumns,leftAlias,rightAlias, limitQuery) {	
	var joinCore = newJoinCore(rightTable,leftColumns,rightColumns,leftAlias,rightAlias);
	var subQuery = negotiateSubQuery();
	var postSql = ' ' +  rightAlias + ' ON (' + joinCore + ')';
	return  subQuery.prepend(' INNER JOIN ').append(postSql);
 
	function negotiateSubQuery() {
		if (limitQuery) {
			return newParameterized('(').append(limitQuery).append(')');
		}
		return newParameterized(rightTable._dbName);
	}
}
 
module.exports = newShallowJoinSql;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/addSubQueries/oneLegToQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/addSubQueries/oneLegToQuery.js

Statements: 42.86% (6 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 42.86% (6 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201 1 1   1   1                       1  
var newShallowJoinSql = require('./newShallowJoinSql');
var addSubQueries = require('../addSubQueries');
var newParameterized = require('../newParameterized');
 
var emptyFilter;
 
function oneLegToQuery(queries, rightAlias,leg,legNo,filter, innerJoin, limitQuery) {	
	var leftAlias = rightAlias + '_' + legNo;
	var span = leg.span;
	var rightTable = leg.table;
	var rightColumns = rightTable._primaryColumns;
	var leftColumns = leg.columns;	 
	 
	var shallowJoin  = newShallowJoinSql(rightTable,leftColumns,rightColumns,leftAlias,rightAlias,limitQuery);
	innerJoin = shallowJoin.append(innerJoin);	
	return addSubQueries(queries, span.table,filter,span,leftAlias,innerJoin);
}
 
module.exports = oneLegToQuery;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractFilterSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractFilterSpec/

Statements: 40% (2 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/query/extractFilterSpec/
File Statements Branches Functions Lines
req.js 40% (2 / 5) 100% (0 / 0) 0% (0 / 1) 40% (2 / 5)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractFilterSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractFilterSpec/req.js

Statements: 40% (2 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 92   1            
var requireMock = require('a').requireMock;
 
function act(c){	
	c.emptyFilter = requireMock('../../emptyFilter');
	c.sut = require('../extractFilter');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractLimitSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractLimitSpec/

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/query/extractLimitSpec/
File Statements Branches Functions Lines
req.js 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractLimitSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractLimitSpec/req.js

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 152   1                        
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.span = {};
 
	c.sut = require('../extractLimit');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractOrderBySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractOrderBySpec/

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/query/extractOrderBySpec/
File Statements Branches Functions Lines
req.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractOrderBySpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractOrderBySpec/req.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 142   1                      
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	c.table = {};
	c.alias = 'alias';
	c.sut = require('../extractOrderBy');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractSqlSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractSqlSpec/

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/query/extractSqlSpec/
File Statements Branches Functions Lines
req.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractSqlSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/extractSqlSpec/req.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 61       1  
function act(c){	
	c.sut = require('../extractSql');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/newSingleQuerySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/newSingleQuerySpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/query/newSingleQuerySpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/newSingleQuerySpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/newSingleQuerySpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
    .it('should set queryContext').assertEqual(c.queryContext, c.sut.queryContext)
    .it('should set parameters to concated parameters').assertDeepEqual(c.parameters, c.sut.parameters);
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/parameterized/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/parameterized/

Statements: 80% (4 / 5)      Branches: 50% (1 / 2)      Functions: 100% (1 / 1)      Lines: 80% (4 / 5)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/query/parameterized/
File Statements Branches Functions Lines
extractParameters.js 80% (4 / 5) 50% (1 / 2) 100% (1 / 1) 80% (4 / 5)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/parameterized/extractParameters.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/parameterized/extractParameters.js

Statements: 80% (4 / 5)      Branches: 50% (1 / 2)      Functions: 100% (1 / 1)      Lines: 80% (4 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 9 101 5     5     1    
function extract(parameters) {	
	Iif (parameters) {
		return parameters.slice(0);	
	}
	return [];
}
 
module.exports = extract;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/

Statements: 27.27% (24 / 88)      Branches: 0% (0 / 14)      Functions: 0% (0 / 17)      Lines: 27.27% (24 / 88)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/
File Statements Branches Functions Lines
negotiateExclusive.js 42.86% (3 / 7) 0% (0 / 4) 0% (0 / 1) 42.86% (3 / 7)
negotiateLimit.js 28.57% (2 / 7) 0% (0 / 4) 0% (0 / 1) 28.57% (2 / 7)
newColumnSql.js 50% (3 / 6) 100% (0 / 0) 0% (0 / 1) 50% (3 / 6)
newDiscriminatorSql.js 22.73% (5 / 22) 0% (0 / 2) 0% (0 / 4) 22.73% (5 / 22)
newJoinSql.js 26.32% (5 / 19) 100% (0 / 0) 0% (0 / 5) 26.32% (5 / 19)
newQueryContext.js 21.43% (3 / 14) 100% (0 / 0) 0% (0 / 4) 21.43% (3 / 14)
newWhereSql.js 23.08% (3 / 13) 0% (0 / 4) 0% (0 / 1) 23.08% (3 / 13)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/negotiateExclusive.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/negotiateExclusive.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121   1               1  
var getSessionSingleton = require('../../getSessionSingleton');
 
function negotiateExclusive(table, alias, _exclusive) {
	if (table._exclusive || _exclusive) {
		var encode =  getSessionSingleton('selectForUpdateSql');
		return encode(alias);
	}
	return '';
}
 
module.exports = negotiateExclusive;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/negotiateLimit.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/negotiateLimit.js

Statements: 28.57% (2 / 7)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 28.57% (2 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111                 1  
function negotiateLimit(limit) {
	if(!limit)
		return '';
 
	if(limit.charAt(0) !== ' ')
		return ' ' + limit;
	return limit;
}
 
module.exports = negotiateLimit;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/newColumnSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/newColumnSql.js

Statements: 50% (3 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 91 1   1          
var newShallowColumnSql = require('./columnSql/newShallowColumnSql');
var newJoinedColumnSql = require('./columnSql/newJoinedColumnSql');
 
module.exports = function(table,span,alias) {
	var shallowColumnSql = newShallowColumnSql(table,alias);
	var joinedColumnSql = newJoinedColumnSql(span,alias);
	return shallowColumnSql + joinedColumnSql;
};
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/newDiscriminatorSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/newDiscriminatorSql.js

Statements: 22.73% (5 / 22)      Branches: 0% (0 / 2)      Functions: 0% (0 / 4)      Lines: 22.73% (5 / 22)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 341               1               1               1               1  
function newDiscriminatorSql(table, alias) {
	var result = '';
	var formulaDiscriminators = table._formulaDiscriminators;
	var columnDiscriminators = table._columnDiscriminators;
	addFormula();
	addColumn();
	return result;
 
	function addFormula() {
		for (var i = 0; i<formulaDiscriminators.length; i++) {
			var current = formulaDiscriminators[i].replace('@this',alias);
			and();
			result += '(' + current + ')';
		}
	}
 
	function addColumn() {
		for (var i = 0; i< columnDiscriminators.length; i++) {
			var current = columnDiscriminators[i];
			and();
			result += alias + '.' + current;
		}
	}
 
	function and() {
		if(result)
			result += ' AND ';
		else
			result = ' ';	
	}
}
 
module.exports = newDiscriminatorSql;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/newJoinSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/newJoinSql.js

Statements: 26.32% (5 / 19)      Branches: 100% (0 / 0)      Functions: 0% (0 / 5)      Lines: 26.32% (5 / 19)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 311 1   1                               1                   1  
var joinLegToJoinSql = require('./joinSql/joinLegToJoinSql');
var oneLegToJoinSql = require('./joinSql/oneLegToJoinSql');
 
function _new(span,alias) {
	var sql = '';
	var legNo = 0;
	var childAlias;
 
	var c = {};	
	c.visitJoin = function(leg) {
		sql = sql + joinLegToJoinSql(leg,alias,childAlias);
	};
 
	c.visitOne = function(leg) {
		sql = sql + oneLegToJoinSql(leg,alias,childAlias);
	};
 
	c.visitMany = function(leg) {};
 
	function onEachLeg(leg) {
		childAlias = alias + '_' + legNo;
		leg.accept(c);
		legNo++;
	}
 
	span.legs.forEach(onEachLeg);
	return sql;
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/newQueryContext.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/newQueryContext.js

Statements: 21.43% (3 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 4)      Lines: 21.43% (3 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251   1                                         1  
var newCollection = require('../../../newCollection');
 
function newQueryContext(filter, alias, innerJoin) {
	var rows = newCollection();
 
	var c = {};
	c.filter = filter;
	c.alias = alias;
	c.innerJoin = innerJoin;
 
	c.expand = function(relation) {
		rows.forEach(function(row) {
			relation.expand(row);
		});
	};
 
	c.add = function(row) {
		rows.add(row);
	};
 
	return c;
}
 
module.exports = newQueryContext;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/newWhereSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/newWhereSql.js

Statements: 23.08% (3 / 13)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181   1                           1  
var newDiscriminatorSql = require('./newDiscriminatorSql');
 
function newWhereSql(table,filter,alias) {
	var separator = ' where';
	var result = '';
	var sql = filter.sql();
	var discriminator = newDiscriminatorSql(table, alias);
	if (sql) {
		result = separator + ' ' + sql;
		separator = ' AND';
	}
	if(discriminator)
		result += separator + discriminator;
	return result;	
}
 
module.exports = newWhereSql;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/columnSql/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/columnSql/

Statements: 28.95% (11 / 38)      Branches: 100% (0 / 0)      Functions: 0% (0 / 9)      Lines: 28.95% (11 / 38)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/columnSql/
File Statements Branches Functions Lines
joinLegToColumnSql.js 45.45% (5 / 11) 100% (0 / 0) 0% (0 / 2) 45.45% (5 / 11)
newJoinedColumnSql.js 18.75% (3 / 16) 100% (0 / 0) 0% (0 / 5) 18.75% (3 / 16)
newShallowColumnSql.js 27.27% (3 / 11) 100% (0 / 0) 0% (0 / 2) 27.27% (3 / 11)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/columnSql/joinLegToColumnSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/columnSql/joinLegToColumnSql.js

Statements: 45.45% (5 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 45.45% (5 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1   1             1         1  
var newShallowColumnSql = require('./newShallowColumnSql');	
var newJoinedColumnSql = _initJOinedColumnSql;
 
function sql(leg,alias) {
	var span = leg.span;
	var shallowColumnSql = newShallowColumnSql(span.table,alias);
	var joinedColumnSql = newJoinedColumnSql(span,alias);
	return ',' + shallowColumnSql + joinedColumnSql;
}
 
function _initJOinedColumnSql(span,alias) {
	newJoinedColumnSql = require('./newJoinedColumnSql');	
	return newJoinedColumnSql(span,alias);
} 
 
module.exports = sql;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/columnSql/newJoinedColumnSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/columnSql/newJoinedColumnSql.js

Statements: 18.75% (3 / 16)      Branches: 100% (0 / 0)      Functions: 0% (0 / 5)      Lines: 18.75% (3 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 301   1                                       1              
var joinLegToColumnSql = require('./joinLegToColumnSql');
 
module.exports = function(span,alias) {
	var index = 0;
	var c = {};
	var sql = '';
 
	c.visitJoin = function(leg) {
		var joinSql = joinLegToColumnSql(leg,alias + '_' + index);
		sql = sql + joinSql;
	};
 
	c.visitOne = function (leg) {
		c.visitJoin(leg);
	};
 
	c.visitMany = function(leg) {
	};
 
	span.legs.forEach(onEach);
 
 
	function onEach(leg) {
		leg.accept(c);
		index++;
	}
 
	return sql;
};
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/columnSql/newShallowColumnSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/columnSql/newShallowColumnSql.js

Statements: 27.27% (3 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 27.27% (3 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171                   1         1  
function _new(table,alias) {
	var aliasDot = alias + '.';
	var commaAliasDot = ',' + aliasDot;
	var columns = table._columns;
	var sql = aliasDot + encodeColumn(0);
	for (var i = 1; i < columns.length; i++) {
		sql = sql + commaAliasDot + encodeColumn(i);
	}
	return sql;
 
	function encodeColumn(i) {
		return columns[i]._dbName + ' as s' + alias + i;
	}
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/

Statements: 45.61% (26 / 57)      Branches: 0% (0 / 2)      Functions: 0% (0 / 10)      Lines: 45.61% (26 / 57)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/
File Statements Branches Functions Lines
joinLegToJoinSql.js 62.5% (5 / 8) 100% (0 / 0) 0% (0 / 2) 62.5% (5 / 8)
joinLegToShallowJoinSql.js 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 1) 42.86% (3 / 7)
newDiscriminatorSql.js 42.86% (3 / 7) 0% (0 / 2) 0% (0 / 1) 42.86% (3 / 7)
newShallowJoinSql.js 50% (3 / 6) 100% (0 / 0) 0% (0 / 1) 50% (3 / 6)
newShallowJoinSqlCore.js 28.57% (4 / 14) 100% (0 / 0) 0% (0 / 2) 28.57% (4 / 14)
oneLegToJoinSql.js 62.5% (5 / 8) 100% (0 / 0) 0% (0 / 2) 62.5% (5 / 8)
oneLegToShallowJoinSql.js 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 1) 42.86% (3 / 7)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/joinLegToJoinSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/joinLegToJoinSql.js

Statements: 62.5% (5 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1   1         1         1  
var joinLegToShallowJoinSql = require('./joinLegToShallowJoinSql');
var newJoinSql = _newJoinSql; 
 
function toJoinSql(leg,alias,childAlias) {
	return joinLegToShallowJoinSql(leg,alias,childAlias) +
			newJoinSql(leg.span,childAlias);
}
 
function _newJoinSql() {
	newJoinSql = require('../newJoinSql');
	return newJoinSql.apply(null,arguments);
}
 
module.exports = toJoinSql;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/joinLegToShallowJoinSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/joinLegToShallowJoinSql.js

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111   1             1  
var newShallowJoinSql = require('./newShallowJoinSql');
 
function toJoinSql(leg,alias,childAlias) {
	var parentTable = leg.table;
	var columns = leg.columns;
	var childTable = leg.span.table;
	return ' LEFT' + newShallowJoinSql(childTable,columns,childTable._primaryColumns,alias,childAlias);
}
 
module.exports = toJoinSql;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/newDiscriminatorSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/newDiscriminatorSql.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121   1               1  
var newDiscriminatorSqlCore = require('../newDiscriminatorSql');
 
function newDiscriminatorSql(table, alias) {
	var result = newDiscriminatorSqlCore(table,alias);
	if (result)
		return ' AND' + result;
	return result;
	
}
 
module.exports = newDiscriminatorSql;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/newShallowJoinSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/newShallowJoinSql.js

Statements: 50% (3 / 6)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (3 / 6)      Ignored: none     

1 2 3 4 5 6 7 8 9 101   1           1  
var newJoinCore = require('./newShallowJoinSqlCore');
 
function _new(rightTable,leftColumns,rightColumns,leftAlias,rightAlias) {	
	var sql = ' JOIN ' + rightTable._dbName + ' ' +  rightAlias + ' ON (';
	sql += newJoinCore(rightTable,leftColumns,rightColumns,leftAlias,rightAlias) + ')';
	return sql;
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/newShallowJoinSqlCore.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/newShallowJoinSqlCore.js

Statements: 28.57% (4 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 28.57% (4 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221   1               1                   1  
var newDiscriminatorSql = require('./newDiscriminatorSql');
 
function _new(rightTable,leftColumns,rightColumns,leftAlias,rightAlias) {	
	var sql = '';
	var delimiter = '';
	for (var i = 0; i < leftColumns.length; i++) {
		addColumn(i);
		delimiter = ' AND ';
	}
	
	function addColumn(index) {
		var leftColumn = leftColumns[index];
		var rightColumn = rightColumns[index];
		sql += delimiter + leftAlias + '.' + leftColumn._dbName + '=' + rightAlias + '.' + rightColumn._dbName;
	}
 
	sql += newDiscriminatorSql(rightTable,rightAlias);
	return sql;
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/oneLegToJoinSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/oneLegToJoinSql.js

Statements: 62.5% (5 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1   1         1         1  
var oneLegToShallowJoinSql = require('./oneLegToShallowJoinSql');
var newJoinSql = _newJoinSql;
 
function toJoinSql(leg,alias,childAlias) {	
	return oneLegToShallowJoinSql(leg,alias,childAlias) +
			newJoinSql(leg.span,childAlias);
}
 
function _newJoinSql() {
	newJoinSql = require('../newJoinSql');
	return newJoinSql.apply(null,arguments);
}
 
module.exports = toJoinSql;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/oneLegToShallowJoinSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/query/singleQuery/joinSql/oneLegToShallowJoinSql.js

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 111   1             1  
var newShallowJoinSql = require('./newShallowJoinSql');
 
function toJoinSql(leg,alias,childAlias) {
	var parentTable = leg.table;
	var columns = leg.columns;
	var childTable = leg.span.table;
	return ' LEFT' + newShallowJoinSql(childTable,parentTable._primaryColumns,columns,alias,childAlias);
}
 
module.exports = toJoinSql;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/

Statements: 26% (13 / 50)      Branches: 0% (0 / 10)      Functions: 0% (0 / 8)      Lines: 26% (13 / 50)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/readStream/
File Statements Branches Functions Lines
extractLimit.js 40% (2 / 5) 0% (0 / 2) 0% (0 / 1) 40% (2 / 5)
extractOrderBy.js 16% (4 / 25) 0% (0 / 8) 0% (0 / 3) 16% (4 / 25)
newQuery.js 26.67% (4 / 15) 100% (0 / 0) 0% (0 / 3) 26.67% (4 / 15)
newQueryStream.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/extractLimit.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/extractLimit.js

Statements: 40% (2 / 5)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 40% (2 / 5)      Ignored: none     

1 2 3 4 5 6 7 81           1  
function extractLimit(span) {
	if (span.limit)
		return ' limit ' + span.limit;
	return '';
}
 
module.exports = extractLimit;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/extractOrderBy.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/extractOrderBy.js

Statements: 16% (4 / 25)      Branches: 0% (0 / 8)      Functions: 0% (0 / 3)      Lines: 16% (4 / 25)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 401                                 1                     1                 1    
function extractOrderBy(alias, span) {
    var table = span.table;
    var dbNames = [];
    var orderBy = span.orderBy;
    var i;
    if (span.orderBy) {
        if (typeof orderBy === 'string')
            orderBy = [orderBy];
        for (i = 0; i < orderBy.length; i++) {
            var nameAndDirection = extractNameAndDirection(orderBy[i]);
            pushColumn(nameAndDirection.name, nameAndDirection.direction);
        }
    } else
        for (i = 0; i < table._primaryColumns.length; i++) {
            pushColumn(table._primaryColumns[i].alias);
        }
 
    function extractNameAndDirection(orderBy) {
        var elements = orderBy.split(' ');
        var direction = '';
        if (elements.length > 1) {
            direction = ' ' + elements[1];
        }
        return {
            name: elements[0],
            direction: direction
        };
    }
    function pushColumn(property, direction) {
        direction = direction || '';
        var column = table[property];
        dbNames.push(alias + '.' + column._dbName + direction);
    }
 
    return ' order by ' + dbNames.join(',');
}
 
module.exports = extractOrderBy;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/newQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/newQuery.js

Statements: 26.67% (4 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 26.67% (4 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241 1   1                                     1  
var newMySqlQuery = require('./mySql/newQuery');
var newPgQuery = require('./pg/newQuery');
 
function newQuery(db,table,filter,span,alias) {	
	var c = {};
	var _newQuery;
 
	c.visitPg = function() {
		_newQuery = newPgQuery;
	};
	c.visitMySql = function() {};
		_newQuery = newMySqlQuery;
 
	db.accept(c);
 
	var args = [];
	for (var i = 1; i < arguments.length; i++) {
		args.push(arguments[i]);
	}
	return _newQuery.apply(null, args);
}
 
module.exports = newQuery
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/newQueryStream.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/newQueryStream.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 91   1         1  
var getSessionSingleton = require('../getSessionSingleton');
 
function newQueryStream(query, options) {
	var dbClient = getSessionSingleton('dbClient');
	return dbClient.streamQuery(query, options);
}
 
module.exports = newQueryStream;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/

Statements: 58.33% (7 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 58.33% (7 / 12)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/
File Statements Branches Functions Lines
newQuery.js 58.33% (7 / 12) 100% (0 / 0) 0% (0 / 1) 58.33% (7 / 12)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/newQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/newQuery.js

Statements: 58.33% (7 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 58.33% (7 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1 1 1 1   1                 1  
var newSingleQuery = require('./query/newSingleQuery');
var newSubQueries = require('./query/newSubQueries');
var extractFilter = require('../../query/extractFilter');
var extractOrderBy = require('../extractOrderBy');
var extractLimit = require('../extractLimit');
 
function newQuery(table,filter,span,alias) {	
	filter = extractFilter(filter);
	var orderBy = extractOrderBy(alias,span);
	var limit = extractLimit(span);
 
	var subQueries = newSubQueries(table,span,alias);
	return newSingleQuery(table,filter,alias,subQueries,orderBy,limit);
}
 
module.exports = newQuery;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/query/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/query/

Statements: 35.71% (15 / 42)      Branches: 100% (0 / 0)      Functions: 0% (0 / 10)      Lines: 35.71% (15 / 42)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/query/
File Statements Branches Functions Lines
newSingleQuery.js 42.86% (6 / 14) 100% (0 / 0) 0% (0 / 2) 42.86% (6 / 14)
newSubQueries.js 32.14% (9 / 28) 100% (0 / 0) 0% (0 / 8) 32.14% (9 / 28)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/query/newSingleQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/query/newSingleQuery.js

Statements: 42.86% (6 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 42.86% (6 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221 1 1 1   1                             1  
var newColumnSql = require('./singleQuery/newShallowColumnSql');
var newWhereSql = require('../../../query/singleQuery/newWhereSql');
var template = 'select json_object(%s%s) as result from %s %s%s%s%s';
var util = require('util');
 
function _new(table,filter,alias,subQueries,orderBy,limit) {
	var c = {};
 
	c.sql = function() {
		var name = table._dbName;
		var columnSql = newColumnSql(table,alias);
		var whereSql = newWhereSql(table,filter,alias);
		return util.format(template, columnSql, subQueries, name, alias, whereSql, orderBy, limit);
	};
	
	c.parameters = filter.parameters;	
 
	return c;
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/query/newSubQueries.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/query/newSubQueries.js

Statements: 32.14% (9 / 28)      Branches: 100% (0 / 0)      Functions: 0% (0 / 8)      Lines: 32.14% (9 / 28)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 481 1 1   1                                 1               1         1         1             1  
var joinLegToQuery = _joinLegToQuery;
var oneLegToQuery = _oneLegToQuery;
var manyLegToQuery = _manyLegToQuery;
 
function newSubQueries(table,span,alias) {
	var result = [];
	var c = {};
	var _legNo;
 
	c.visitJoin = function(leg) {
		result.push(joinLegToQuery( alias,leg,_legNo));
	};
	c.visitOne = function(leg) {
		result.push(oneLegToQuery( alias,leg,_legNo));
	};
	c.visitMany = function(leg) {
		result.push(manyLegToQuery( alias,leg,_legNo));
	};
 
	span.legs.forEach(onEachLeg);	
 
	function onEachLeg(leg,legNo) {
		_legNo = legNo;
		leg.accept(c);
	}
 
	return result.join('');
}
 
function _joinLegToQuery() {
	joinLegToQuery = require('./newSubQueries/joinLegToQuery');	
	return joinLegToQuery.apply(null,arguments);
}
 
function _oneLegToQuery() {
	oneLegToQuery = require('./newSubQueries/oneLegToQuery');	
	return oneLegToQuery.apply(null,arguments);
}
 
function _manyLegToQuery() {
	manyLegToQuery = require('./newSubQueries/manyLegToQuery');	
	return manyLegToQuery.apply(null,arguments);
}
 
 
 
module.exports = newSubQueries;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/query/singleQuery/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/query/singleQuery/

Statements: 23.08% (3 / 13)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/query/singleQuery/
File Statements Branches Functions Lines
newShallowColumnSql.js 23.08% (3 / 13) 0% (0 / 4) 0% (0 / 1) 23.08% (3 / 13)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/query/singleQuery/newShallowColumnSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/mySql/query/singleQuery/newShallowColumnSql.js

Statements: 23.08% (3 / 13)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181   1                           1  
var util = require('util');
 
function _new(table,alias) {
	var columnFormat = "'%s',%s.%s";
	var columns = table._columns;
	var sql = '';
	var separator = '';
	for (var i = 0; i < columns.length; i++) {
		var column = columns[i];
		if (!('serializable' in column && !column.serializable))
			sql = sql + separator + util.format(columnFormat, column.alias, alias, column._dbName);
		separator = ',';
	}
	return sql;
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/

Statements: 57.89% (11 / 19)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 57.89% (11 / 19)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/readStream/pg/
File Statements Branches Functions Lines
newQuery.js 60% (3 / 5) 100% (0 / 0) 0% (0 / 1) 60% (3 / 5)
newQueryCore.js 57.14% (8 / 14) 100% (0 / 0) 0% (0 / 1) 57.14% (8 / 14)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/newQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/newQuery.js

Statements: 60% (3 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 60% (3 / 5)      Ignored: none     

1 2 3 4 5 6 7 8 91   1         1  
var newQueryCore = require('./newQueryCore');
 
function newQuery(table,filter,span,alias) {	
	var query = newQueryCore.apply(null, arguments);
	return query.prepend('select row_to_json(r)::text as result from (').append(') r');
}
 
module.exports = newQuery;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/newQueryCore.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/newQueryCore.js

Statements: 57.14% (8 / 14)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 57.14% (8 / 14)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181 1 1 1 1 1   1                 1  
var newSingleQuery = require('./query/newSingleQuery');
var newSubQueries = require('./query/newSubQueries');
var extractFilter = require('../../query/extractFilter');
var extractOrderBy = require('../extractOrderBy');
var extractLimit = require('../extractLimit');
var newParameterized = require('../../query/newParameterized');
 
function newQuery(table,filter,span,alias) {	
	filter = extractFilter(filter);
	var orderBy = extractOrderBy(alias,span);
	var limit = extractLimit(span);
	var subQueries = newSubQueries(table,span,alias);
	var query = newSingleQuery(table,filter,alias,subQueries,orderBy,limit);
	return newParameterized(query.sql(), query.parameters);
}
 
module.exports = newQuery;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/query/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/query/

Statements: 32.5% (13 / 40)      Branches: 100% (0 / 0)      Functions: 0% (0 / 10)      Lines: 32.5% (13 / 40)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/readStream/pg/query/
File Statements Branches Functions Lines
newSingleQuery.js 33.33% (4 / 12) 100% (0 / 0) 0% (0 / 2) 33.33% (4 / 12)
newSubQueries.js 32.14% (9 / 28) 100% (0 / 0) 0% (0 / 8) 32.14% (9 / 28)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/query/newSingleQuery.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/query/newSingleQuery.js

Statements: 33.33% (4 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 33.33% (4 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201 1   1                             1  
var newColumnSql = require('./singleQuery/newShallowColumnSql');
var newWhereSql = require('../../../query/singleQuery/newWhereSql');
 
function _new(table,filter,alias,subQueries,orderBy,limit) {
	var c = {};
 
	c.sql = function() {
		var name = table._dbName;
		var columnSql = newColumnSql(table,alias);
		var whereSql = newWhereSql(table,filter,alias);
		return 'select ' + columnSql + subQueries + ' from ' + name + ' ' + alias  + whereSql + orderBy + limit;
	};
 
	c.parameters = filter.parameters;	
 
	return c;
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/query/newSubQueries.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/query/newSubQueries.js

Statements: 32.14% (9 / 28)      Branches: 100% (0 / 0)      Functions: 0% (0 / 8)      Lines: 32.14% (9 / 28)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 481 1 1   1                                 1               1         1         1             1  
var joinLegToQuery = _joinLegToQuery;
var oneLegToQuery = _oneLegToQuery;
var manyLegToQuery = _manyLegToQuery;
 
function newSubQueries(table,span,alias) {
	var result = [];
	var c = {};
	var _legNo;
 
	c.visitJoin = function(leg) {
		result.push(joinLegToQuery( alias,leg,_legNo));
	};
	c.visitOne = function(leg) {
		result.push(oneLegToQuery( alias,leg,_legNo));
	};
	c.visitMany = function(leg) {
		result.push(manyLegToQuery( alias,leg,_legNo));
	};
 
	span.legs.forEach(onEachLeg);	
 
	function onEachLeg(leg,legNo) {
		_legNo = legNo;
		leg.accept(c);
	}
 
	return result.join('');
}
 
function _joinLegToQuery() {
	joinLegToQuery = require('./newSubQueries/joinLegToQuery');	
	return joinLegToQuery.apply(null,arguments);
}
 
function _oneLegToQuery() {
	oneLegToQuery = require('./newSubQueries/oneLegToQuery');	
	return oneLegToQuery.apply(null,arguments);
}
 
function _manyLegToQuery() {
	manyLegToQuery = require('./newSubQueries/manyLegToQuery');	
	return manyLegToQuery.apply(null,arguments);
}
 
 
 
module.exports = newSubQueries;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/query/singleQuery/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/query/singleQuery/

Statements: 23.08% (3 / 13)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/readStream/pg/query/singleQuery/
File Statements Branches Functions Lines
newShallowColumnSql.js 23.08% (3 / 13) 0% (0 / 4) 0% (0 / 1) 23.08% (3 / 13)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/query/singleQuery/newShallowColumnSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStream/pg/query/singleQuery/newShallowColumnSql.js

Statements: 23.08% (3 / 13)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 23.08% (3 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181   1                           1  
var util = require('util');
 
function _new(table,alias) {
	var columnFormat = '%s as "%s"';
	var columns = table._columns;
	var sql = '';
	var separator = alias + '.';
	for (var i = 0; i < columns.length; i++) {
		var column = columns[i];
		if (!('serializable' in column && !column.serializable))
			sql = sql + separator + util.format(columnFormat, column._dbName, column.alias);
		separator = ',' + alias + '.';
	}
	return sql;
}
 
module.exports = _new;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStreamDefault/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStreamDefault/

Statements: 16.67% (4 / 24)      Branches: 0% (0 / 8)      Functions: 0% (0 / 2)      Lines: 16.67% (4 / 24)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/readStreamDefault/
File Statements Branches Functions Lines
createBatchFilter.js 16.67% (4 / 24) 0% (0 / 8) 0% (0 / 2) 16.67% (4 / 24)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStreamDefault/createBatchFilter.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/readStreamDefault/createBatchFilter.js

Statements: 16.67% (4 / 24)      Branches: 0% (0 / 8)      Functions: 0% (0 / 2)      Lines: 16.67% (4 / 24)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 411   1                       1                                               1    
var emptyFilter = require('../../emptyFilter');
 
function createBatchFilter(table, filter, strategy, lastDto) {
    if (!lastDto) {
        return filter;
    }
 
    var orderBy = strategy.orderBy;
 
    for (var i = 0; i < strategy.orderBy.length; i++) {
        var subFilter = createSubFilter(i);
        filter = filter.or(subFilter);
    }
 
    function createSubFilter(index) {
        var subFilter = emptyFilter;
        for (var i = 0; i < index + 1; i++) {
            var order = orderBy[i];
            var elements = order.split(' ');
            var name = elements[0];
            var direction = elements[1] || 'asc';
            var value = lastDto[name];
            if (index === i) {
                if (direction === 'asc')
                    subFilter = subFilter.and(table[name].greaterThan(value));
                else
                    subFilter = subFilter.and(table[name].lessThan(value));
            } else
                subFilter = subFilter.and(table[name].eq(value));
        }
        return subFilter;
    }
 
    return filter;
}
 
 
 
module.exports = createBatchFilter;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relatedTable/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relatedTable/

Statements: 23.66% (22 / 93)      Branches: 0% (0 / 6)      Functions: 0% (0 / 13)      Lines: 23.66% (22 / 93)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/relatedTable/
File Statements Branches Functions Lines
joinSql.js 14.81% (4 / 27) 0% (0 / 2) 0% (0 / 4) 14.81% (4 / 27)
relatedColumn.js 26.32% (5 / 19) 0% (0 / 2) 0% (0 / 3) 26.32% (5 / 19)
selectSql.js 50% (4 / 8) 100% (0 / 0) 0% (0 / 1) 50% (4 / 8)
subFilter.js 41.67% (5 / 12) 100% (0 / 0) 0% (0 / 1) 41.67% (5 / 12)
whereSql.js 14.81% (4 / 27) 0% (0 / 2) 0% (0 / 4) 14.81% (4 / 27)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relatedTable/joinSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relatedTable/joinSql.js

Statements: 14.81% (4 / 27)      Branches: 0% (0 / 2)      Functions: 0% (0 / 4)      Lines: 14.81% (4 / 27)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 431   1                                       1                                   1    
var newShallowJoinSql = require('../query/singleQuery/joinSql/newShallowJoinSql');
 
function newJoinSql(relations) {
	if (relations.length == 1)
		return  '';
	var leftAlias,
		rightAlias;
	var relation;
	var c = {};
	var i;
	var sql = '';
 
	c.visitJoin = function(relation) {
		sql += ' INNER' + newShallowJoinSql(relation.parentTable,relation.childTable._primaryColumns,relation.columns,leftAlias,rightAlias);	
	};
 
	c.visitOne = function(relation) {	
		innerJoin(relation);
	};
 
	c.visitMany = c.visitOne;
 
	function innerJoin(relation) {
		var joinRelation = relation.joinRelation;
		var table = joinRelation.childTable;		
		var rightColumns = table._primaryColumns;		
		var leftColumns = joinRelation.columns;
 
		sql += ' INNER' + newShallowJoinSql(table,leftColumns,rightColumns,leftAlias,rightAlias);	
	}
 
	for (i = relations.length-1; i > 0; i--) {
		leftAlias = '_' + (i+1);
		rightAlias = '_' + i;
		relation = relations[i];
		relation.accept(c);
	}
	return sql;
}
 
module.exports = newJoinSql;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relatedTable/relatedColumn.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relatedTable/relatedColumn.js

Statements: 26.32% (5 / 19)      Branches: 0% (0 / 2)      Functions: 0% (0 / 3)      Lines: 26.32% (5 / 19)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 311   1                     1     1                         1  
var newSubFilter = require('./subFilter');
 
function newRelatedColumn(column,relations) {
	var c = {};
	var alias = '_' + relations.length;
	for (var propName in column) {
		var prop = column[propName];
		if (prop instanceof Function)			
 
			c[propName] = wrapFilter(prop);
	}
	return c;
 
	function wrapFilter(filter) {
		return runFilter;
		
		function runFilter() {
			var args = [];
			for (var i = 0; i < arguments.length; i++) {
				args.push(arguments[i]);
			}
			args.push(alias);
			var shallowFilter =  filter.apply(null,args);
			return newSubFilter(relations,shallowFilter);
		}
	}
 
}
 
module.exports = newRelatedColumn;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relatedTable/selectSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relatedTable/selectSql.js

Statements: 50% (4 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 50% (4 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 131 1   1             1    
var newParameterized = require('../query/newParameterized');
var newBoolean = require('../column/newBoolean');
 
function newSelectSql(table, alias) {
	var colName = table._primaryColumns[0]._dbName;
	var sql = 'SELECT ' + alias + '.' + colName + ' FROM ' + table._dbName + ' AS ' + alias;
	sql = newParameterized(sql);
	return newBoolean(sql);
}
 
module.exports = newSelectSql;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relatedTable/subFilter.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relatedTable/subFilter.js

Statements: 41.67% (5 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 41.67% (5 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1 1   1                     1  
var newSelect = require('./selectSql');
var newJoin = require('./joinSql');
var newWhere = require('./whereSql');
 
function newSubFilter(relations, shallowFilter) {
	var relationCount = relations.length;
	var alias = '_' + relationCount;
	var table = relations[relationCount-1].childTable;
	var filter = newSelect(table,alias).prepend('EXISTS (');
	var join = newJoin(relations);
	var where = newWhere(relations[0],shallowFilter);
	return filter.append(join).append(where).append(')');
 
}
 
module.exports = newSubFilter;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relatedTable/whereSql.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relatedTable/whereSql.js

Statements: 14.81% (4 / 27)      Branches: 0% (0 / 2)      Functions: 0% (0 / 4)      Lines: 14.81% (4 / 27)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 411   1                                             1                         1    
var newShallowJoinSql = require('../query/singleQuery/joinSql/newShallowJoinSqlCore');
 
function newWhereSql(relation,shallowFilter) {
	var c = {};
	var sql;
 
	c.visitJoin = function(relation) {
		var table = relation.childTable;
		var alias = relation.parentTable._dbName;
		var leftColumns = relation.columns;
		var rightColumns = table._primaryColumns;
		where(alias,leftColumns,rightColumns);
	};
 
	c.visitOne = function(relation) {
		var joinRelation = relation.joinRelation;
		var rightColumns = joinRelation.columns;		
		var childTable = joinRelation.childTable;
		var leftColumns = childTable._primaryColumns;
		var alias = childTable._dbName;
		where(alias,leftColumns,rightColumns);
	};
 
	c.visitMany = c.visitOne;
 
	function where(alias,leftColumns,rightColumns) {
		var table = relation.childTable;
		var joinCore = newShallowJoinSql(table,leftColumns,rightColumns,alias,'_1');
		if (shallowFilter)
			sql = shallowFilter.prepend(' WHERE ' + joinCore + ' AND ');		
		else
			sql = ' WHERE ' + joinCore;
	}
 
	relation.accept(c);
	return sql;
}
 
module.exports = newWhereSql;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/

Statements: 27.34% (38 / 139)      Branches: 0% (0 / 8)      Functions: 0% (0 / 24)      Lines: 27.34% (38 / 139)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/relation/
File Statements Branches Functions Lines
newExpanderCache.js 75% (3 / 4) 100% (0 / 0) 0% (0 / 1) 75% (3 / 4)
newForeignKeyFilter.js 25% (3 / 12) 100% (0 / 0) 0% (0 / 2) 25% (3 / 12)
newJoinLeg.js 20% (3 / 15) 100% (0 / 0) 0% (0 / 2) 20% (3 / 15)
newManyCache.js 32.43% (12 / 37) 0% (0 / 2) 0% (0 / 6) 32.43% (12 / 37)
newManyCacheCore.js 22.86% (8 / 35) 0% (0 / 4) 0% (0 / 7) 22.86% (8 / 35)
newManyLeg.js 33.33% (3 / 9) 100% (0 / 0) 0% (0 / 2) 33.33% (3 / 9)
newOneCache.js 27.27% (3 / 11) 0% (0 / 2) 0% (0 / 2) 27.27% (3 / 11)
newOneLeg.js 18.75% (3 / 16) 100% (0 / 0) 0% (0 / 2) 18.75% (3 / 16)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newExpanderCache.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newExpanderCache.js

Statements: 75% (3 / 4)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 75% (3 / 4)      Ignored: none     

1 2 3 4 5 6 7 81   1       1  
var newRowCache = require('../newRowCache');
 
function newExpanderCache(joinRelation) {
	return newRowCache(joinRelation.childTable);	
}
 
module.exports = newExpanderCache;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newForeignKeyFilter.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newForeignKeyFilter.js

Statements: 25% (3 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 25% (3 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211                     1               1  
function newForeignKeyFilter(joinRelation, parentRow) {
    var columns = joinRelation.columns;
    var rightTable = joinRelation.childTable;
 
    var filter = getNextFilterPart(0);
 
    for (var i = 1; i < columns.length; i++) {
 
        filter = filter.and(getNextFilterPart(i));
    }
 
    function getNextFilterPart(index) {
        var column = columns[index];
        var pk = rightTable._primaryColumns[index];
        return column.eq(parentRow[pk.alias]);
    }
    return filter;
}
 
module.exports = newForeignKeyFilter;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newJoinLeg.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newJoinLeg.js

Statements: 20% (3 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 20% (3 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231   1                                   1    
var newCollection = require('../../newCollection');
 
function newLeg(relation) {
	var c = {};
	var span = {};	
	span.table = relation.childTable;
	span.legs = newCollection();
	c.span = span;
	c.name = relation.leftAlias;
	c.table = relation.parentTable;
	c.columns = relation.columns;
	c.expand = relation.expand;
 
	c.accept = function(visitor) {
		visitor.visitJoin(c);
	};
 
	return c;	
}
 
module.exports = newLeg;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newManyCache.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newManyCache.js

Statements: 32.43% (12 / 37)      Branches: 0% (0 / 2)      Functions: 0% (0 / 6)      Lines: 32.43% (12 / 37)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 561 1 1 1 1 1 1 1   1                                                       1           1                     1  
var synchronizeChanged = require('./manyCache/synchronizeChanged');
var synchronizeAdded = require('./manyCache/synchronizeAdded');
var synchronizeRemoved = require('./manyCache/synchronizeRemoved');
var extractParentKey = require('./manyCache/extractParentKey');
var newCacheCore = require('./newManyCacheCore');
var newId = require('../../newId');
var getSessionSingleton = require('../getSessionSingleton');
var setSessionSingleton = require('../setSessionSingleton');
 
function newManyCache(joinRelation) {
    var c = {};
    var key = newId();
 
    c.tryAdd = function(parent, child) {
        var cache = getSessionSingleton(key);
        cache.tryAdd(parent, child);
        synchronizeChanged(c, joinRelation, parent, child);
    };
 
    c.tryRemove = function(parent, child) {
        var cache = getSessionSingleton(key);
        cache.tryRemove(parent, child);
    };
 
    c.tryGet = function(parentRow) {
        var cache = getSessionSingleton(key);
        if (!cache) {
            cache = newCacheCore(joinRelation);
            setSessionSingleton(key, cache);
            fillCache(cache);
            synchronizeAdded(c.tryAdd, joinRelation);
            synchronizeRemoved(c.tryRemove, joinRelation);
        }
        return cache.tryGet(parentRow);
    };
 
 
    function fillCache(cache) {
        var childTable = joinRelation.parentTable;
        var childCache = childTable._cache;
        var children = childCache.getAll();
        children.forEach(addToCache);
 
        function addToCache(child) {
            var parent = extractParentKey(joinRelation, child);  
            c.tryAdd(parent, child);
        }
    }
 
    
 
    return c;
}
 
module.exports = newManyCache;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newManyCacheCore.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newManyCacheCore.js

Statements: 22.86% (8 / 35)      Branches: 0% (0 / 4)      Functions: 0% (0 / 7)      Lines: 22.86% (8 / 35)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 541 1   1                         1                       1                         1     1               1  
var newCacheCore = require('../newCache');
var newRowArray = require('../rowArray');
 
function newManyCache(joinRelation) {
    var c = {};
    var cache = newCacheCore();
    var primaryColumns = joinRelation.childTable._primaryColumns;
 
    c.tryGet = function(parentRow) {
        var key = toKey(parentRow);
        var rows =  cache.tryGet(key);
        if (!rows) 
            return newArray();
        return rows;
    };
 
    function tryAdd(parentRow, childRow) {
        var key = toKey(parentRow);
        var existing = cache.tryGet(key);
        if(existing) {
            existing.push(childRow);
            return;
        }
        var rows = newArray();
        rows.push(childRow);
        existing = cache.tryAdd(key, rows);
    }
 
    function newArray() {
        return newRowArray(joinRelation.parentTable);
    }
 
    c.tryAdd = tryAdd;
 
    c.tryRemove = function(parentRow, childRow) {
        var key = toKey(parentRow);
        var existing = cache.tryGet(key);
        var index = existing.indexOf(childRow);
        existing.splice(index,1);
    };
 
    function toKey(row) {
        return primaryColumns.map(onColumn);
 
        function onColumn(column) {
            return row[column.alias];
        }
    }
 
    return c;
}
 
module.exports = newManyCache;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newManyLeg.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newManyLeg.js

Statements: 33.33% (3 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 33.33% (3 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171   1                       1    
var newOneLeg = require('./newOneLeg');
 
function newLeg(relation) {	
	var c = newOneLeg(relation);
	c.name = relation.joinRelation.rightAlias;
	c.accept = function(visitor) {
		visitor.visitMany(c);
	};
 
	c.expand = relation.expand;
	
	return c; 
}
 
module.exports = newLeg;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newOneCache.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newOneCache.js

Statements: 27.27% (3 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 27.27% (3 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181   1                         1    
var newManyCache = require('./newManyCache');
 
function newOneCache(joinRelation) {
	var c = {};
	var cache = newManyCache(joinRelation);
 
	c.tryGet = function(parent) {
		var res = cache.tryGet(parent);
		if (res.length === 0)
			return null;
		return res[0];
	};
	return c;
}
 
module.exports = newOneCache;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newOneLeg.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/newOneLeg.js

Statements: 18.75% (3 / 16)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 18.75% (3 / 16)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251   1                                       1    
var newCollection = require('../../newCollection');
 
function newLeg(relation) {
 
	var joinRelation = relation.joinRelation;
	var c = {};
	c.name = joinRelation.rightAlias;
	var span = {};		
	span.table = joinRelation.parentTable;	
	span.legs = newCollection();
	c.span = span;
	c.table = joinRelation.childTable;
	c.columns = joinRelation.columns;
	c.expand = relation.expand;
 
	c.accept = function(visitor) {
		visitor.visitOne(c);
	};
 
	return c;	
}
 
module.exports = newLeg;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/manyCache/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/manyCache/

Statements: 41.86% (18 / 43)      Branches: 100% (0 / 0)      Functions: 0% (0 / 11)      Lines: 41.86% (18 / 43)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/relation/manyCache/
File Statements Branches Functions Lines
extractParentKey.js 30% (3 / 10) 100% (0 / 0) 0% (0 / 2) 30% (3 / 10)
synchronizeAdded.js 50% (4 / 8) 100% (0 / 0) 0% (0 / 2) 50% (4 / 8)
synchronizeChanged.js 41.18% (7 / 17) 100% (0 / 0) 0% (0 / 5) 41.18% (7 / 17)
synchronizeRemoved.js 50% (4 / 8) 100% (0 / 0) 0% (0 / 2) 50% (4 / 8)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/manyCache/extractParentKey.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/manyCache/extractParentKey.js

Statements: 30% (3 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 30% (3 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181               1               1  
function extractParentKey(joinRelation, child) {
 
    var childTable = joinRelation.childTable;
    var primaryColumns = childTable._primaryColumns;
    var parent = {};
 
    joinRelation.columns.forEach(addKeyToParent);
 
    function addKeyToParent(childPk, index) {
        var primaryColumn = primaryColumns[index];
        parent[primaryColumn.alias] = child[childPk.alias];
    }
 
    return parent;
}
 
module.exports = extractParentKey;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/manyCache/synchronizeAdded.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/manyCache/synchronizeAdded.js

Statements: 50% (4 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 50% (4 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151   1       1           1    
var extractParentKey = require('./extractParentKey');
 
function synchronizeAdded(action, joinRelation) {
	var cache = joinRelation.parentTable._cache;
	cache.subscribeAdded(onAdded);
	
	function onAdded(child) {
		var parent = extractParentKey(joinRelation, child);
		action(parent, child);
	}
}
 
module.exports = synchronizeAdded;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/manyCache/synchronizeChanged.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/manyCache/synchronizeChanged.js

Statements: 41.18% (7 / 17)      Branches: 100% (0 / 0)      Functions: 0% (0 / 5)      Lines: 41.18% (7 / 17)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 321   1         1       1     1         1                     1  
var extractParentKey = require('./extractParentKey');
 
function synchronizeChanged(manyCache, joinRelation, parent, child) {
    var columns = joinRelation.columns;
    columns.forEach(subscribeColumn);
    child = null;
 
    function subscribeColumn(column) {
        child.subscribeChanged(onChanged, column.alias);
    }
 
    function unsubscribe(child) {
        columns.forEach(unsubscribeColumn);
 
        function unsubscribeColumn(column) {
            child.unsubscribeChanged(onChanged, column.alias);
        }
    }
 
    function onChanged(child) {
        unsubscribe(child);
        manyCache.tryRemove(parent, child);
        var newParent = extractParentKey(joinRelation, child);
        manyCache.tryAdd(newParent, child);
    }
 
 
 
}
 
module.exports = synchronizeChanged;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/manyCache/synchronizeRemoved.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/relation/manyCache/synchronizeRemoved.js

Statements: 50% (4 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 50% (4 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151   1       1           1    
var extractParentKey = require('./extractParentKey');
 
function synchronizeRemoved(action, joinRelation) {
	var cache = joinRelation.parentTable._cache;
	cache.subscribeRemoved(onRemoved);
	
	function onRemoved(child) {
		var parent = extractParentKey(joinRelation, child);
		action(parent, child);
	}
}
 
module.exports = synchronizeRemoved;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/releaseDbClientSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/releaseDbClientSpec/

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/releaseDbClientSpec/
File Statements Branches Functions Lines
req.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/releaseDbClientSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/releaseDbClientSpec/req.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 162       1                      
var a = require('a');
var mock = a.mock;
var requireMock = a.requireMock;
 
function act(c){
	c.mock = mock;	
	c.getSessionSingleton = requireMock('./getSessionSingleton');
	c.deleteSessionContext = requireMock('./deleteSessionContext');
 
	c.deleteSessionContext.expect();	
 
	c.sut = require('../releaseDbClient');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToPromiseSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToPromiseSpec/

Statements: 40% (4 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 40% (4 / 10)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/resultToPromiseSpec/
File Statements Branches Functions Lines
toPromise.js 42.86% (3 / 7) 100% (0 / 0) 0% (0 / 2) 42.86% (3 / 7)
whenToPromise.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToPromiseSpec/toPromise.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToPromiseSpec/toPromise.js

Statements: 42.86% (3 / 7)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 152   1         1              
var requireMock = require('a').requireMock;
 
function toPromise(c) {
	c.result = {};
 
	require('../resultToPromise')(c.result).then(onResult);
 
	function onResult(returned) {
		c.returned = returned;
	}
 
}
 
module.exports = toPromise;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToPromiseSpec/whenToPromise.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToPromiseSpec/whenToPromise.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c).
	it('should return result').assertEqual(c.result, c.returned)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/

Statements: 26.63% (53 / 199)      Branches: 0% (0 / 20)      Functions: 0% (0 / 42)      Lines: 26.63% (53 / 199)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/resultToRows/
File Statements Branches Functions Lines
dbRowToRow.js 25.93% (7 / 27) 100% (0 / 0) 0% (0 / 6) 25.93% (7 / 27)
dbRowsToRows.js 40% (4 / 10) 100% (0 / 0) 0% (0 / 1) 40% (4 / 10)
decodeDbRow.js 33.33% (3 / 9) 0% (0 / 2) 0% (0 / 2) 33.33% (3 / 9)
delete.js 40% (6 / 15) 100% (0 / 0) 0% (0 / 3) 40% (6 / 15)
negotiateQueryContext.js 50% (2 / 4) 0% (0 / 2) 0% (0 / 1) 50% (2 / 4)
newDecodeDbRow.js 16.84% (16 / 95) 0% (0 / 12) 0% (0 / 18) 16.84% (16 / 95)
subResultToRows.js 36.84% (7 / 19) 100% (0 / 0) 0% (0 / 5) 36.84% (7 / 19)
toDto.js 40% (8 / 20) 0% (0 / 4) 0% (0 / 6) 40% (8 / 20)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/dbRowToRow.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/dbRowToRow.js

Statements: 25.93% (7 / 27)      Branches: 100% (0 / 0)      Functions: 0% (0 / 6)      Lines: 25.93% (7 / 27)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 451 1 1     1                                                   1             1         1  
var negotiateQueryContext = require('./negotiateQueryContext');
var decodeDbRow = require('./decodeDbRow');
var nextDbRowToRow = _nextDbRowToRow;
 
 
function dbRowToRow(span, dbRow, queryContext) {
	var table = span.table;
	var row = decodeDbRow(span, table, dbRow);
	negotiateQueryContext(queryContext, row);
	row.queryContext = queryContext;		
	var cache = table._cache;
	row = cache.tryAdd(row);
 
	var c = {};
	
	c.visitOne = function(leg) {
		nextDbRowToRow(leg.span, dbRow);
		leg.expand(row);
	};
 
	c.visitJoin = function(leg) {
		nextDbRowToRow(leg.span, dbRow);
		leg.expand(row);		
	};
 
	c.visitMany = function(leg) {
		leg.expand(row);		
	};
 
	span.legs.forEach(onEach);
 
	function onEach (leg) {
		leg.accept(c);
	}
 
	return row;
}
 
function _nextDbRowToRow (span, dbRow) {
	nextDbRowToRow = require('./dbRowToRow');
	nextDbRowToRow(span, dbRow);
}
 
module.exports = dbRowToRow;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/dbRowsToRows.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/dbRowsToRows.js

Statements: 40% (4 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 40% (4 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1   1                   1  
var dbRowToRow = require('./dbRowToRow');
var newRowArray = require('../rowArray');
 
function dbRowsToRows(span, dbRows) {
    var rows = newRowArray(span.table);
    var queryContext = dbRows.queryContext;
    for (var i = 0; i < dbRows.length; i++) {
        var row = dbRowToRow(span, dbRows[i], queryContext);
        rows.push(row);
    }
    return rows;
}
 
module.exports = dbRowsToRows;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/decodeDbRow.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/decodeDbRow.js

Statements: 33.33% (3 / 9)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 33.33% (3 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191   1                           1    
var newDecodeDbRow = require('./newDecodeDbRow');
 
function decodeDbRow(context, table, dbRow) {
    var decode = context._decodeDbRow;
    if (!decode) {
        decode = newDecodeDbRow(table, dbRow);
        Object.defineProperty(context, '_decodeDbRow', {
            enumerable: false,
            get: function() {
                return decode;
            },
        });
    }
    return decode(dbRow);
}
 
module.exports = decodeDbRow;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/delete.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/delete.js

Statements: 40% (6 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 40% (6 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221 1 1 1   1                             1  
var removeFromCache = require('./delete/removeFromCache');	
var pushCommand = require('../commands/pushCommand');
var newDeleteCommand = require('../commands/newDeleteCommand');
var newPrimaryKeyFilter = require('../newPrimaryKeyFilter');
 
function _delete(row, strategy, table) {
	var relations = [];
	removeFromCache(row, strategy, table);
 
	var args = [table];
	table._primaryColumns.forEach(function(primary) {
		args.push(row[primary.alias]);
	});
	var filter = newPrimaryKeyFilter.apply(null, args);
	var cmds = newDeleteCommand([], table, filter, strategy, relations);
	cmds.forEach(function(cmd) {
		pushCommand(cmd);
	});
}
 
module.exports = _delete;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/negotiateQueryContext.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/negotiateQueryContext.js

Statements: 50% (2 / 4)      Branches: 0% (0 / 2)      Functions: 0% (0 / 1)      Lines: 50% (2 / 4)      Ignored: none     

1 2 3 4 5 6 71         1  
function negotiateQueryContext(queryContext, row) {
	if (queryContext)
			queryContext.add(row);	
}
 
module.exports = negotiateQueryContext;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/newDecodeDbRow.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/newDecodeDbRow.js

Statements: 16.84% (16 / 95)      Branches: 0% (0 / 12)      Functions: 0% (0 / 18)      Lines: 16.84% (16 / 95)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 1521 1 1 1 1 1 1 1   1                                 1                                                       1               1               1                                                                                                                       1                 1                   1    
var updateField = require('../updateField');
var newEmitEvent = require('../../emitEvent');
var extractStrategy = require('./toDto/extractStrategy');
var extractDeleteStrategy = require('../extractDeleteStrategy');
var newCascadeDeleteStrategy = require('../newCascadeDeleteStrategy');
var _delete = require('./delete');
var newObject = require('../../newObject');
var toDto = require('./toDto');
 
function newDecodeDbRow(table, dbRow) {
    var columns = table._columns;
    var numberOfColumns = columns.length;
    if (dbRow.offset === undefined) {
        dbRow.offset = 0;
    }
 
    var offset = dbRow.offset;
 
    var keys = Object.keys(dbRow);
 
    for (var i = 0; i < numberOfColumns; i++) {
        defineColumnProperty(i);
    }
 
    dbRow.offset += numberOfColumns;
 
    function defineColumnProperty(i) {
        var column = columns[i];
        var purify = column.purify;
        var decode = column.decode
        var name = column.alias;
        i = offset + i;
        var key = keys[i];
 
        Object.defineProperty(Row.prototype, name, {
 
            get: function() {
                return this._dbRow[key];
            },
            set: function(value) {
                var oldValue = this[name];
                value = purify(value);
                this._dbRow[key] = value;
                updateField(table, column, this);
                var emit = this._emitColumnChanged[name];
                if (emit)
                    emit(this, column, value, oldValue);
                this._emitChanged(this, column, value, oldValue);
            }
        });
    }
 
    setRelated();
 
    function setRelated() {
        var relations = table._relations;
        for (var relationName in relations) {
            var relation = relations[relationName];
            setSingleRelated(relationName, relation);
        }
    }
 
    function setSingleRelated(name, relation) {
        Object.defineProperty(Row.prototype, name, {
            get: function() {
                return createGetRelated(this, name)();
            }
        });
    }
 
    function createGetRelated(row, alias) {
        var get = row._related[alias];
        if (!get) {
            var relation = table._relations[alias];
            get = relation.toGetRelated(row);
            row._related[alias] = get;
        }
        return get;
    }
 
 
    Row.prototype.subscribeChanged = function(onChanged, name) {
        var emit;
        if (name) {
            emit = this._emitColumnChanged[name] || (this._emitColumnChanged[name] = newEmitEvent());
            emit.add(onChanged);
            return
        }
        this._emitChanged.add(onChanged);
    };
 
    Row.prototype.unsubscribeChanged = function(onChanged, name) {
        if (name) {
            this._emitColumnChanged[name].tryRemove(onChanged);
            return;
        }
        this._emitChanged.tryRemove(onChanged);
    };
 
    Row.prototype.toJSON = function(strategy) {
        return this.toDto.apply(this, arguments).then(JSON.stringify);
    };
 
    Row.prototype.toDto = function(strategy) {
        var args = Array.prototype.slice.call(arguments, 0);
        args.push(table);
        strategy = extractStrategy.apply(null, args);
        return toDto(strategy, table, this);
    };
 
    Row.prototype.expand = function(alias) {
        var get = createGetRelated(this, alias);
        get.expanded = true;
    };
 
    Row.prototype.isExpanded = function(alias) {
        var get = createGetRelated(this, alias);
        return get.expanded;
    };
 
    Row.prototype.delete = function(strategy) {
        strategy = extractDeleteStrategy(strategy, table);
        _delete(this, strategy, table);
    };
 
    Row.prototype.cascadeDelete = function() {
        var strategy = newCascadeDeleteStrategy(newObject(), table);
        _delete(this, strategy, table);
    };
 
    function decodeDbRow(row) {
        for (var i = 0; i < numberOfColumns; i++) {
            var index = offset + i;
            var key = keys[index];            
            row[key] = columns[i].decode(row[key]);
        }
        return new Row(row);
    }
 
    function Row(dbRow) {
        this._dbRow = dbRow;
        this._related = {};
        this._emitColumnChanged = {};
        this._emitChanged = newEmitEvent();
    }
 
    return decodeDbRow;
}
 
module.exports = newDecodeDbRow;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/subResultToRows.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/subResultToRows.js

Statements: 36.84% (7 / 19)      Branches: 100% (0 / 0)      Functions: 0% (0 / 5)      Lines: 36.84% (7 / 19)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 311 1 1   1                         1             1         1  
var all = require('../promise').all;
var nextResultToRows = _nextResultToRows;
var resultToRows = require('../resultToRows');
 
function subResultToRows(span,result) {	
	var promises = [];
	var c2 = {};
	c2.visitJoin = function(leg) {
		promises.push(nextResultToRows(leg.span,result));
	};
 
	c2.visitOne = c2.visitJoin;
 
	c2.visitMany = function(leg) {		
		promises.push(resultToRows(leg.span, result));
	};
	
	function onEachLeg(leg) {			
		leg.accept(c2);
	}
	span.legs.forEach(onEachLeg);	
	return all(promises);
}
 
function _nextResultToRows(span,result) {
	nextResultToRows = require('./subResultToRows');
	return nextResultToRows(span,result);
}
 
module.exports = subResultToRows;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/toDto.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/toDto.js

Statements: 40% (8 / 20)      Branches: 0% (0 / 4)      Functions: 0% (0 / 6)      Lines: 40% (8 / 20)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 371 1   1                 1     1       1         1                   1    
var resultToPromise = require('../resultToPromise');
var createDto = require('./toDto/createDto');
 
function toDto(strategy, table, row) {
    var dto = createDto(strategy, table, row);
    strategy = strategy || {};
    var promise = resultToPromise(dto);
 
    for (var property in strategy) {
        mapChild(property);            
    }
 
    function mapChild(name) {
        promise = promise.then(getRelated).then(onChild);
        
        function getRelated() {
            return row[name];
        }
 
        function onChild(child) {
            if (child) 
                return child.toDto(strategy[name]).then(onChildDto);                
        }
 
        function onChildDto(childDto) {
            dto[name] = childDto;
        }
    }
 
    return promise.then(function() {
        return dto;
    });
}
 
module.exports = toDto;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/delete/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/delete/

Statements: 28.57% (6 / 21)      Branches: 0% (0 / 4)      Functions: 0% (0 / 5)      Lines: 28.57% (6 / 21)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/resultToRows/delete/
File Statements Branches Functions Lines
removeFromCache.js 28.57% (6 / 21) 0% (0 / 4) 0% (0 / 5) 28.57% (6 / 21)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/delete/removeFromCache.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/delete/removeFromCache.js

Statements: 28.57% (6 / 21)      Branches: 0% (0 / 4)      Functions: 0% (0 / 5)      Lines: 28.57% (6 / 21)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351   1               1           1                     1         1    
var nextRemoveFromCache = _nextRemoveFromCache;
 
function removeFromCache(row, strategy, table) {
    if (Array.isArray(row)) {
    	removeManyRows();
    	return;
    }
    if (row)
        removeSingleRow();
 
    function removeManyRows() {
        row.forEach(function(rowToRemove) {
            nextRemoveFromCache(rowToRemove, strategy, table);
        });
    }
 
    function removeSingleRow() {
        var relations = table._relations;
        for (var relationName in strategy) {
            var relation = relations[relationName];
                var rows = relation.getRowsSync(row);
                nextRemoveFromCache(rows, strategy[relationName], relation.childTable);
        }
        table._cache.tryRemove(row);
    }
}
 
function _nextRemoveFromCache(row, strategy, table) {
    nextRemoveFromCache = require('./removeFromCache');
    nextRemoveFromCache(row, strategy, table);
}
 
module.exports = removeFromCache;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/toDto/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/toDto/

Statements: 18.75% (6 / 32)      Branches: 0% (0 / 6)      Functions: 0% (0 / 5)      Lines: 18.75% (6 / 32)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/resultToRows/toDto/
File Statements Branches Functions Lines
createDto.js 18.18% (2 / 11) 0% (0 / 4) 0% (0 / 1) 18.18% (2 / 11)
extractStrategy.js 19.05% (4 / 21) 0% (0 / 2) 0% (0 / 4) 19.05% (4 / 21)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/toDto/createDto.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/toDto/createDto.js

Statements: 18.18% (2 / 11)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 18.18% (2 / 11)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171                           1    
function _createDto(context, table, row) {
    var dto = {};
    var columns = table._columns;
    var length = columns.length;
    for (var i = 0; i < length; i++) {
        var column = columns[i];
        if (!('serializable' in column && !column.serializable)) {
            var alias = column.alias;
            dto[alias] = row[alias];
        }
    }
    return dto;
}
 
module.exports = _createDto;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/toDto/extractStrategy.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRows/toDto/extractStrategy.js

Statements: 19.05% (4 / 21)      Branches: 0% (0 / 2)      Functions: 0% (0 / 4)      Lines: 19.05% (4 / 21)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 331   1         1                                               1  
var extractSubStrategy = _extractSubStrategy;
 
function _extractSubStrategy(table) {
    extractSubStrategy = require('./extractStrategy');
    return extractSubStrategy(table);
}
 
function extractStrategy() {
    if (arguments.length == 2)
        return arguments[0];
    var table = arguments[0];
    var strategy = {};
    var relations = table._relations;
    var relationName;
 
    var visitor = {};
    visitor.visitJoin = function() {};
 
    visitor.visitMany = function(relation) {
        strategy[relationName] = extractSubStrategy(relation.childTable);
    };
 
    visitor.visitOne = visitor.visitMany;
 
    for (relationName in relations) {
        var relation = relations[relationName];
        relation.accept(visitor);
    }
    return strategy;
}
 
module.exports = extractStrategy;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRowsSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRowsSpec/

Statements: 11.43% (4 / 35)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 11.43% (4 / 35)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/resultToRowsSpec/
File Statements Branches Functions Lines
toRows.js 9.38% (3 / 32) 100% (0 / 0) 0% (0 / 2) 9.38% (3 / 32)
whenToRows.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRowsSpec/toRows.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRowsSpec/toRows.js

Statements: 9.38% (3 / 32)      Branches: 100% (0 / 0)      Functions: 0% (0 / 2)      Lines: 9.38% (3 / 32)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 442       1                                                               1              
var a = require('a');
var mock = a.mock;
var requireMock = a.requireMock;
 
function act(c) {
    c.then = a.then;
    c.mock = a.mock;
    c.requireMock = a.requireMock;
    c.rows = {};
    c.span = {};    
    c.x = 'x';
    c.y = 'y';
    c.z = 'z';
    c.xPromise = c.then();
    c.result = [c.xPromise, c.y, c.z];
    c.xPromise.resolve(c.x);
    c.nextResult = [c.y, c.z];
    c.table = {};
    c.span.table = c.table;
 
    c.promise = requireMock('./promise');
    c.promise.all = mock();
    c.dbRowsToRows = requireMock('./resultToRows/dbRowsToRows');
 
    c.sut = require('../resultToRows');
 
    c.dbRowsToRows.expect(c.span, c.x).return(c.rows);
 
    c.subResultToRows = requireMock('./resultToRows/subResultToRows');
    c.subRows = {};
    c.subRowsPromise = c.then();
    c.subRowsPromise.resolve(c.subRows);
    c.subResultToRows.expect(c.span, c.nextResult).return(c.subRowsPromise);
 
    c.sut(c.span, c.result).then(onOk, console.log);
 
    function onOk(returned) {
        c.returned = returned;
    }
}
 
module.exports = act;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRowsSpec/whenToRows.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/resultToRowsSpec/whenToRows.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 92                
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return rows').assertEqual(c.rows,c.returned)
	.it('should create subrows').assertDoesNotThrow(c.subResultToRows.verify)	
	
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rollbackSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rollbackSpec/

Statements: 15.38% (2 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 15.38% (2 / 13)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/rollbackSpec/
File Statements Branches Functions Lines
req.js 15.38% (2 / 13) 100% (0 / 0) 0% (0 / 1) 15.38% (2 / 13)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rollbackSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rollbackSpec/req.js

Statements: 15.38% (2 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 15.38% (2 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  2         1                            
 
var a  = require('a');
var mock = a.mock;
var requireMock  = a.requireMock;
 
 
function act(c){		
	c.mock = mock;
	c.rollbackCommand = requireMock('./commands/rollbackCommand');
	c.executeQuery = requireMock('./executeQueries/executeQuery');
	c.releaseDbClient = requireMock('./releaseDbClient');
	c.popChanges = requireMock('./popChanges');
	c.newThrow = requireMock('./newThrow');
	c.resultToPromise = requireMock('./resultToPromise');
	
	c.sut = require('../rollback');
}
 
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rowArray/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rowArray/

Statements: 20.93% (9 / 43)      Branches: 0% (0 / 20)      Functions: 0% (0 / 7)      Lines: 20.93% (9 / 43)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/rowArray/
File Statements Branches Functions Lines
negotiateNextTick.js 37.5% (3 / 8) 0% (0 / 4) 0% (0 / 1) 37.5% (3 / 8)
orderBy.js 17.14% (6 / 35) 0% (0 / 16) 0% (0 / 6) 17.14% (6 / 35)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rowArray/negotiateNextTick.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rowArray/negotiateNextTick.js

Statements: 37.5% (3 / 8)      Branches: 0% (0 / 4)      Functions: 0% (0 / 1)      Lines: 37.5% (3 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121   1               1  
var promise = require('promise/domains');
 
function negotiateNextTick(i) {	
	if (i === 0)
		return;
	if (i % 1000 === 0)
		return promise.resolve();
	return;
}
 
module.exports = negotiateNextTick;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rowArray/orderBy.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rowArray/orderBy.js

Statements: 17.14% (6 / 35)      Branches: 0% (0 / 16)      Functions: 0% (0 / 6)      Lines: 17.14% (6 / 35)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 541               1                             1                   1           1                       1    
function orderBy(strategy, rows) {
    if (strategy && strategy.orderBy) {
        var comparer = createComparer(strategy.orderBy);
        return rows.sort(comparer);
    }
    return rows;
}
 
function createComparer(orderBy) {
    var comparers = [];
    if (typeof orderBy === 'string')
        orderBy = [orderBy];
    orderBy.forEach(function(order) {
        var elements = order.split(' ');
        var name = elements[0];
        var direction = elements[1] || 'asc';
 
        var compare;
        if (direction === 'asc')
            comparers.push(compareAscending);
        else
            comparers.push(compareDescending);
 
        function compareAscending(a, b) {
            a = a[name];
            b = b[name]
            if (a === b)
                return 0;
            if (a < b)
                return -1;
            return 1;
        }
 
        function compareDescending(a, b) {
            return compareAscending(b, a)
        }
 
    });
 
    function compareComposite(a, b) {
        for (var i = 0; i < comparers.length; i++) {
            var result = comparers[i](a, b);
            if (result !== 0)
                return result;
        }
        return 0;
    }
 
    return compareComposite;
}
 
module.exports = orderBy;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rowArraySpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rowArraySpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/rowArraySpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rowArraySpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/rowArraySpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return array').assertDeepEqual(true, c.sut instanceof Array)
	.it('should return empty array').assertEqual(0, c.sut.length)
	.it('toJSON should not be enumerable').assertEqual(false, c.sut.propertyIsEnumerable('toJSON'))
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/setSessionSingletonSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/setSessionSingletonSpec/

Statements: 20% (3 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (3 / 15)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/setSessionSingletonSpec/
File Statements Branches Functions Lines
set.js 16.67% (2 / 12) 100% (0 / 0) 0% (0 / 1) 16.67% (2 / 12)
whenSet.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/setSessionSingletonSpec/set.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/setSessionSingletonSpec/set.js

Statements: 16.67% (2 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 16.67% (2 / 12)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 202   1                                  
var a = require('a');
 
function act(c){
	c.mock = a.mock;
	c.requireMock = a.requireMock;
	c.expectRequire = a.expectRequire;
	c.then = a.then;
	
	c.context = {};
 
	c.getSessionContext = c.requireMock('./getSessionContext');
	c.getSessionContext.expect().return(c.context);
 
	c.expected = {};
	
	require('../setSessionSingleton')('foo', c.expected);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/setSessionSingletonSpec/whenSet.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/setSessionSingletonSpec/whenSet.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should set value on context').assertEqual(c.expected, c.context.foo)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/strategyToSpanSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/strategyToSpanSpec/

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/strategyToSpanSpec/
File Statements Branches Functions Lines
req.js 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/strategyToSpanSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/strategyToSpanSpec/req.js

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 132       1                
var a = require('a');
var requireMock = a.requireMock;
var table = {};
 
function act(c){
	c.table = table;
	c.mock = a.mock;	
	c.newCollection = requireMock('../newCollection');
	c.sut = require('../strategyToSpan');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetByIdSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetByIdSpec/

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/tryGetByIdSpec/
File Statements Branches Functions Lines
whenNew.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetByIdSpec/whenNew.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetByIdSpec/whenNew.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)
	.it('should set exclusive').assertEqual(c.tryGetFromDbById.exclusive, c.sut.exclusive)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFirstFromDbSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFirstFromDbSpec/

Statements: 13.33% (2 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 13.33% (2 / 15)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/tryGetFirstFromDbSpec/
File Statements Branches Functions Lines
req.js 13.33% (2 / 15) 100% (0 / 0) 0% (0 / 1) 13.33% (2 / 15)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFirstFromDbSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFirstFromDbSpec/req.js

Statements: 13.33% (2 / 15)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 13.33% (2 / 15)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 242   1                                          
var a = require('a');
 
function act(c) {
	c.requireMock = a.requireMock;
	c.mock = a.mock;
	c.getMany = c.requireMock('./getMany');
	c.util = c.requireMock('util');
	
	
	c.getMany.exclusive = c.mock();
	
	c.table = 't';
	c.filter = 'f';
	c.initialStrategy = 's';
	c.strategy = {};
 
	c.util._extend = c.mock();
	c.util._extend.expect({limit: 1}, c.initialStrategy).return(c.strategy);
	
	c.sut = require('../tryGetFirstFromDb');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFromCacheByIdSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFromCacheByIdSpec/

Statements: 12.5% (3 / 24)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 12.5% (3 / 24)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/tryGetFromCacheByIdSpec/
File Statements Branches Functions Lines
get.js 9.52% (2 / 21) 100% (0 / 0) 0% (0 / 1) 9.52% (2 / 21)
whenGet.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFromCacheByIdSpec/get.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFromCacheByIdSpec/get.js

Statements: 9.52% (2 / 21)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 9.52% (2 / 21)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 302   1                                                      
var mock =require('a').mock;
 
function act(c){
	c.table = {};
	c.id = {};
	c.id2 = {};
	c.strategy = {};
	
	c.pk1 = {};
	c.pk1.alias = 'pk1Alias';
 
	c.pk2 = {};
	c.pk2.alias = 'pk2Alias';
 
	c.table._primaryColumns = [c.pk1, c.pk2];
 
	c.cache = {};
	c.cache.tryGet = mock();
	c.key = {};
	c.key.pk1Alias = c.id;
	c.key.pk2Alias = c.id2;
	c.cache.tryGet.expect(c.key).return(c.expected);
	c.table._cache = c.cache;
 
	c.sut = require('../tryGetFromCacheById');
	c.returned = c.sut(c.table, c.id, c.id2, c.strategy);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFromCacheByIdSpec/whenGet.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFromCacheByIdSpec/whenGet.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 7 82              
var when = require('a').when;
var c = {};
 
when(c)
	.it('should return cached item').assertEqual(c.expected, c.returned)
	;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFromDbById/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFromDbById/

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/tryGetFromDbById/
File Statements Branches Functions Lines
extractStrategy.js 42.86% (3 / 7) 0% (0 / 2) 0% (0 / 2) 42.86% (3 / 7)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFromDbById/extractStrategy.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryGetFromDbById/extractStrategy.js

Statements: 42.86% (3 / 7)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 42.86% (3 / 7)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14  1             1       1  
 
function extract(table) {
	var lengthWithStrategy = table._primaryColumns.length  + 2;
	if (arguments.length == lengthWithStrategy)
		return arguments[lengthWithStrategy-1];
	return emptyStrategy;
}
 
function emptyStrategy() {
	
}
 
module.exports = extract;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryReleaseDbClientSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryReleaseDbClientSpec/

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/tryReleaseDbClientSpec/
File Statements Branches Functions Lines
req.js 22.22% (2 / 9) 100% (0 / 0) 0% (0 / 1) 22.22% (2 / 9)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryReleaseDbClientSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/tryReleaseDbClientSpec/req.js

Statements: 22.22% (2 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 22.22% (2 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 162   1                          
var a = require('a');
 
function act(c) {
    c.mock = a.mock;
    c.requireMock = a.requireMock;
    c.expectRequire = a.expectRequire;
    c.then = a.then;
 
    c.releaseDbClient = c.requireMock('./releaseDbClient');
 
    c.sut = require('../tryReleaseDbClient');
}
 
module.exports = act;
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/updateFieldSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/updateFieldSpec/

Statements: 15.38% (2 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 15.38% (2 / 13)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/table/updateFieldSpec/
File Statements Branches Functions Lines
req.js 15.38% (2 / 13) 100% (0 / 0) 0% (0 / 1) 15.38% (2 / 13)
Code coverage report for node-npmtest-rdb/node_modules/rdb/table/updateFieldSpec/req.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/table/updateFieldSpec/req.js

Statements: 15.38% (2 / 13)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 15.38% (2 / 13)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 182       1                          
var a = require('a');
var mock = a.mock;
var requireMock = a.requireMock;
 
function act(c){
	c.mock = mock;	
	c.newUpdateCommand = requireMock('./commands/newUpdateCommand');
	c.pushCommand = requireMock('./commands/pushCommand');
	c.lastCommandMatches = requireMock('./commands/lastCommandMatches');
	c.table = {};
	c.column = {};
	c.row = {}
 
	c.sut = require('../updateField');
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 66.67% (2 / 3)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/tableSpec/
File Statements Branches Functions Lines
when_new.js 66.67% (2 / 3) 100% (0 / 0) 100% (0 / 0) 66.67% (2 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/when_new.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/when_new.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 202 2                                    
var c = {};
var when = require('a').when
 
when('./new', c)
	.it('should set dbName').assertEqual(c.name,c.sut._dbName)
	.it('should set columns to empty array').assertEqual(0,c.sut._columns.length)
	.it('should set primaryColumns to empty array').assertEqual(0,c.sut._primaryColumns.length)
	.it('should set columnDiscriminators to empty array').assertEqual(0,c.sut._columnDiscriminators.length)
	.it('should set formulaDiscriminators to empty array').assertEqual(0,c.sut._formulaDiscriminators.length)
	.it('should set _relations to empty object').assertDoesNotThrow(c.verifyEmptyRelations)
	.it('should set _cache').assertEqual(c.cache, c.sut._cache)
	.it('should set context equal sut').assertEqual(c.context, c.sut)
	.it('should set delete').assertEqual(c.delete, c.sut.delete)
	.it('should set cascadeDelete').assertEqual(c.cascadeDelete, c.sut.cascadeDelete)
	.it('should set createReadStream').assertEqual(c.createReadStream, c.sut.createReadStream)
	.it('should set createJSONReadStream').assertEqual(c.createJSONReadStream, c.sut.createJSONReadStream)
	
	
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/integrationSpec/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/integrationSpec/

Statements: 17.07% (14 / 82)      Branches: 100% (0 / 0)      Functions: 0% (0 / 13)      Lines: 17.07% (14 / 82)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/tableSpec/integrationSpec/
File Statements Branches Functions Lines
defineTable.js 17.07% (14 / 82) 100% (0 / 0) 0% (0 / 13) 17.07% (14 / 82)
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/integrationSpec/defineTable.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/integrationSpec/defineTable.js

Statements: 17.07% (14 / 82)      Branches: 100% (0 / 0)      Functions: 0% (0 / 13)      Lines: 17.07% (14 / 82)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 1122                         1         1               1                     1               1               1             1                   1           1                   1               1       1         1                
var a = require('a');
var requireMock = a.requireMock;
var newQuery;
var strategyToSpan = require('../../table/strategyToSpan');
var table;
var customerTable;
var countryTable;
var lineTable;
var packageTable;
var articleTable;
var deliveryPartyTable;
var emptyInnerJoin = require('../../table/query/newParameterized')();
 
function act(c) {
	createMocks();
	defineTable();	
	setupSut();	
 
	function createMocks() {
		requireMock('./executeQueries');
		requireMock('./resultToRows');
		requireMock('./tryGetFromCacheById');
		c.requireMock = requireMock;
		c.mock = a.mock;
	}
 
	function defineTable() {
		defineOrder();
		defineCustomer();
		defineCountry();
		defineOrderLines();
		defineArticle();		
		definePackages();
		defineArticle();
		defineDeliveryParty();
	}
 
	function defineOrder() {
		table = newTable('order');
		table.primaryColumn('oOrderId').numeric().as('id');
		table.column('oCustomerId').string().as('customerId');		
		table.columnDiscriminators('discriminatorColumn=\'foo\'','discriminatorColumn2=\'baz\'');
		c.orderTable = table;
	}		
 
	function defineCustomer() {
		customerTable = newTable('customer');
		customerTable.primaryColumn('cCustomerId').string().as('id');
		customerTable.column('cName').string().as('name');
		customerTable.column('cCountryId').string().as('countryId');
		var customerJoin = table.join(customerTable).by('oCustomerId').as('customer');
	}
 
	function defineCountry() {
		countryTable = newTable('country');
		countryTable.primaryColumn('yCountryId').numeric().as('id');
		countryTable.column('yCountryName').string().as('name');
		var countryJoin = customerTable.join(countryTable).by('cCountryId').as('country');		
	}
 
	function defineOrderLines() {
		lineTable = newTable('orderLine');
		lineTable.primaryColumn('lId').numeric().as('id');
		lineTable.column('lLineNo').numeric().as('lineNo');
		lineTable.column('lOrderId').numeric().as('orderId');
		var orderJoin = lineTable.join(table).by('lOrderId').as('order');
		table.hasMany(orderJoin).as('lines');
 
	}
 
	function defineArticle() {
		articleTable = newTable('article');
		articleTable.primaryColumn('aId').numeric().as('id');		
		articleTable.column('aName').string().as('name');
	}
 
	function definePackages() {
		packageTable = newTable('package');
		packageTable.primaryColumn('pId').numeric().as('id');
		packageTable.column('pLineId').numeric().as('lineId');
		packageTable.column('pArticleId').numeric().as('articleId');
		var lineJoin = packageTable.join(lineTable).by('pLineId').as('line');
		lineTable.hasMany(lineJoin).as('packages');		
		packageTable.join(articleTable).by('pArticleId').as('article');
	}
 
	function defineDeliveryParty() {
		deliveryPartyTable = newTable('deliveryParty');
		deliveryPartyTable.primaryColumn('dId').numeric().as('id');
		deliveryPartyTable.column('dOrderId').numeric().as('orderId');
		var orderJoin = deliveryPartyTable.join(table).by('dOrderId').as('order');
		table.hasOne(orderJoin).as('deliveryParty');
	}
 
	function newTable(tableName) {
		return require('../../table')(tableName);
	}
 
	function setupSut() {
		newQuery = require('../../table/newQuery');
		c.newQuery = _newQuery;
	}
 
	function _newQuery() {
		var span = strategyToSpan(table, c.strategy);
		c.returned = newQuery([],table,c.filter,span,c.orderTable._dbName,emptyInnerJoin);		
	}
 
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/

Statements: 53.25% (41 / 77)      Branches: 100% (0 / 0)      Functions: 0% (0 / 5)      Lines: 53.25% (41 / 77)      Ignored: none     

All files » node-npmtest-rdb/node_modules/rdb/tableSpec/new/
File Statements Branches Functions Lines
columnDiscriminators.js 62.5% (5 / 8) 100% (0 / 0) 0% (0 / 1) 62.5% (5 / 8)
exclusive.js 66.67% (2 / 3) 100% (0 / 0) 0% (0 / 1) 66.67% (2 / 3)
formulaDiscriminators.js 62.5% (5 / 8) 100% (0 / 0) 0% (0 / 1) 62.5% (5 / 8)
primaryColumn.js 20% (2 / 10) 100% (0 / 0) 0% (0 / 1) 20% (2 / 10)
tryGetFirst.js 33.33% (3 / 9) 100% (0 / 0) 0% (0 / 1) 33.33% (3 / 9)
whenColumnDiscriminators.js 66.67% (2 / 3) 100% (0 / 0) 100% (0 / 0) 66.67% (2 / 3)
whenExclusive.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
whenFormulaDiscriminators.js 66.67% (2 / 3) 100% (0 / 0) 100% (0 / 0) 66.67% (2 / 3)
whenGetById.js 66.67% (2 / 3) 100% (0 / 0) 100% (0 / 0) 66.67% (2 / 3)
whenInsert.js 66.67% (2 / 3) 100% (0 / 0) 100% (0 / 0) 66.67% (2 / 3)
whenTryGetById.js 66.67% (2 / 3) 100% (0 / 0) 100% (0 / 0) 66.67% (2 / 3)
whenTryGetFirst.js 33.33% (1 / 3) 100% (0 / 0) 100% (0 / 0) 33.33% (1 / 3)
when_column.js 66.67% (2 / 3) 100% (0 / 0) 100% (0 / 0) 66.67% (2 / 3)
when_getMany.js 66.67% (2 / 3) 100% (0 / 0) 100% (0 / 0) 66.67% (2 / 3)
when_hasMany.js 66.67% (2 / 3) 100% (0 / 0) 100% (0 / 0) 66.67% (2 / 3)
when_hasOne.js 66.67% (2 / 3) 100% (0 / 0) 100% (0 / 0) 66.67% (2 / 3)
when_join.js 66.67% (2 / 3) 100% (0 / 0) 100% (0 / 0) 66.67% (2 / 3)
when_primaryColumn.js 66.67% (2 / 3) 100% (0 / 0) 100% (0 / 0) 66.67% (2 / 3)
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/columnDiscriminators.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/columnDiscriminators.js

Statements: 62.5% (5 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121 1   1           1 1  
var discriminator1 = {};
var discriminator2 = {};
 
function act(c) {
	c.discriminator1 = discriminator1;
	c.discriminator2 = discriminator2;
	c.returned = c.sut.columnDiscriminators(discriminator1, discriminator2);
}
 
act.base = '../new';
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/exclusive.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/exclusive.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 61       1  
function act(c){
	c.returned = c.sut.exclusive();
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/formulaDiscriminators.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/formulaDiscriminators.js

Statements: 62.5% (5 / 8)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 62.5% (5 / 8)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 121 1   1           1 1  
var discriminator1 = {};
var discriminator2 = {};
 
function act(c) {
	c.discriminator1 = discriminator1;
	c.discriminator2 = discriminator2;
	c.returned = c.sut.formulaDiscriminators(discriminator1, discriminator2);
}
 
act.base = '../new';
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/primaryColumn.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/primaryColumn.js

Statements: 20% (2 / 10)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 20% (2 / 10)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 142       1                  
var requireMock = require('a').requireMock;
var primaryColumnName = {};
var columnDef = {};
 
function act(c) {
	c.expected = {};
	c.columnDef = columnDef;
	c.newColumn.expect(c.sut,primaryColumnName).return(columnDef);	
	c.column.expect(columnDef,c.sut).return(c.expected);
	c.returned = c.sut.primaryColumn(primaryColumnName);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/tryGetFirst.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/tryGetFirst.js

Statements: 33.33% (3 / 9)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 33.33% (3 / 9)      Ignored: none     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151     1                   1  
var filter = {} ,
	strategy = {};
 
function act(c){
	c.expected = {};
	c.tryGetFirstFromDb.expect(c.sut, filter, strategy).return(c.expected);
	c.returned = c.sut.tryGetFirst(filter, strategy);
 
	c.expectedExclusive = {};
	c.tryGetFirstFromDb.exclusive.expect(c.sut, filter, strategy).return(c.expectedExclusive);
	c.returnedExclusive = c.sut.tryGetFirst.exclusive(filter, strategy);
}
 
module.exports = act;
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/whenColumnDiscriminators.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/whenColumnDiscriminators.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 82 2            
var c = {};
var when = require('a').when;
 
when(c).	
	it('should add column discriminator1').assertEqual(c.discriminator1,c.sut._columnDiscriminators[0]).
	it('should add column discriminator2').assertEqual(c.discriminator2,c.sut._columnDiscriminators[1]).
	it('should return sut').assertEqual(c.sut,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/whenExclusive.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/whenExclusive.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 6 72            
var when = require('a').when;
var c = {};
 
when(c)    
    .it('should return table').assertStrictEqual(c.sut, c.returned)
    .it('should set _exclusive').assertEqual(true, c.sut._exclusive)
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/whenFormulaDiscriminators.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/whenFormulaDiscriminators.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 82 2            
var c = {};
var when = require('a').when;
 
when(c).
	it('should add formula discriminator1').assertEqual(c.discriminator1,c.sut._formulaDiscriminators[0]).
	it('should add formula discriminator2').assertEqual(c.discriminator2,c.sut._formulaDiscriminators[1]).
	it('should return sut').assertEqual(c.sut,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/whenGetById.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/whenGetById.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 82 2            
var c = {};
var when = require('a').when;
 
when(c)
	.it('should return expected').assertEqual(c.expected,c.returned)
	.it('should return expected exclusive').assertEqual(c.expectedExclusive,c.returnedExclusive)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/whenInsert.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/whenInsert.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 72 2          
var c = {};
var when = require('a').when;
 
when(c).
	it('should return new row').assertEqual(c.expected,c.returned);	
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/whenTryGetById.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/whenTryGetById.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 72 2          
var c = {};
var when = require('a').when;
 
when(c).
	it('should return expected').assertEqual(c.expected,c.returned);	
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/whenTryGetFirst.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/whenTryGetFirst.js

Statements: 33.33% (1 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 33.33% (1 / 3)      Ignored: none     

1 2 3 4 5 62          
var when = require('a').when;
var c = {};
 
when(c)
    .it('should return first found row').assertEqual(c.expected, c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/when_column.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/when_column.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 72 2          
var c = {};
var when = require('a').when;
 
when('./column', c).
	it('should return expected').assertEqual(c.expected,c.returned);	
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/when_getMany.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/when_getMany.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 82 2            
var c = {};
var when = require('a').when;
 
when('./getMany', c)
	.it('should return expectedExclusive').assertEqual(c.expectedExclusive,c.returnedExclusive)
	.it('should return expected').assertEqual(c.expected,c.returned)
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/when_hasMany.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/when_hasMany.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 72 2          
var c = {};
var when = require('a').when;
 
when('./hasMany', c).
	it('should return expected').assertEqual(c.expected,c.returned);	
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/when_hasOne.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/when_hasOne.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 72 2          
var c = {};
var when = require('a').when;
 
when('./hasOne', c).
	it('should return expected').assertEqual(c.expected,c.returned);	
 
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/when_join.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/when_join.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 62 2        
var c = {};
var when = require('a').when;
 
when('./join',c).
	it('should return expected').assertEqual(c.expected,c.returned);
 
Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/when_primaryColumn.js

npmtest-rdb (v0.0.1)

Code coverage report for node-npmtest-rdb/node_modules/rdb/tableSpec/new/when_primaryColumn.js

Statements: 66.67% (2 / 3)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 66.67% (2 / 3)      Ignored: none     

1 2 3 4 5 6 7 82 2            
var c = {};
var when = require('a').when;
 
when('./primaryColumn', c).
	it('should add primaryColumn to table._primaryColumns').assertEqual(c.columnDef,c.sut._primaryColumns[0]).
	it('should return expected').assertEqual(c.expected,c.returned);